backend_apis
Creates, updates, deletes, gets or lists a backend_apis resource.
Overview
| Name | backend_apis |
| Type | Resource |
| Id | aws.amplifybackend.backend_apis |
Fields
The following fields are returned by SELECT queries:
- get_backend_api
| Name | Datatype | Description |
|---|---|---|
app_id | string | The app ID. |
backend_environment_name | string | The name of the backend environment. |
error | string | If the request fails, this error is returned. |
resource_config | object | The resource config for the data model, configured as a part of the Amplify project. |
resource_name | string | The name of this resource. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_backend_api | select | app_id, backend_environment_name, region | Gets the details for a backend API. | |
create_backend_api | insert | app_id, region, BackendEnvironmentName, ResourceConfig, ResourceName | Creates a new backend API resource. | |
update_backend_api | update | app_id, backend_environment_name, region, ResourceName | Updates an existing backend API resource. | |
delete_backend_api | delete | app_id, backend_environment_name, region | Deletes an existing backend API resource. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
app_id | string | The app ID. |
backend_environment_name | string | The name of the backend environment. |
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_backend_api
Gets the details for a backend API.
SELECT
app_id,
backend_environment_name,
error,
resource_config,
resource_name
FROM aws.amplifybackend.backend_apis
WHERE app_id = '{{ app_id }}' -- required
AND backend_environment_name = '{{ backend_environment_name }}' -- required
AND region = '{{ region }}' -- required
;
INSERT examples
- create_backend_api
- Manifest
Creates a new backend API resource.
INSERT INTO aws.amplifybackend.backend_apis (
BackendEnvironmentName,
ResourceConfig,
ResourceName,
app_id,
region
)
SELECT
'{{ BackendEnvironmentName }}' /* required */,
'{{ ResourceConfig }}' /* required */,
'{{ ResourceName }}' /* required */,
'{{ app_id }}',
'{{ region }}'
RETURNING
app_id,
backend_environment_name,
error,
job_id,
operation,
status
;
# Description fields are for documentation purposes
- name: backend_apis
props:
- name: app_id
value: "{{ app_id }}"
description: Required parameter for the backend_apis resource.
- name: region
value: "{{ region }}"
description: Required parameter for the backend_apis resource.
- name: BackendEnvironmentName
value: "{{ BackendEnvironmentName }}"
- name: ResourceConfig
description: |
The resource config for the data model, configured as a part of the Amplify project.
value:
AdditionalAuthTypes:
- Mode: "{{ Mode }}"
Settings:
CognitoUserPoolId: "{{ CognitoUserPoolId }}"
Description: "{{ Description }}"
ExpirationTime: {{ ExpirationTime }}
OpenIDAuthTTL: "{{ OpenIDAuthTTL }}"
OpenIDClientId: "{{ OpenIDClientId }}"
OpenIDIatTTL: "{{ OpenIDIatTTL }}"
OpenIDIssueURL: "{{ OpenIDIssueURL }}"
OpenIDProviderName: "{{ OpenIDProviderName }}"
ApiName: "{{ ApiName }}"
ConflictResolution:
ResolutionStrategy: "{{ ResolutionStrategy }}"
DefaultAuthType:
Mode: "{{ Mode }}"
Settings:
CognitoUserPoolId: "{{ CognitoUserPoolId }}"
Description: "{{ Description }}"
ExpirationTime: {{ ExpirationTime }}
OpenIDAuthTTL: "{{ OpenIDAuthTTL }}"
OpenIDClientId: "{{ OpenIDClientId }}"
OpenIDIatTTL: "{{ OpenIDIatTTL }}"
OpenIDIssueURL: "{{ OpenIDIssueURL }}"
OpenIDProviderName: "{{ OpenIDProviderName }}"
Service: "{{ Service }}"
TransformSchema: "{{ TransformSchema }}"
- name: ResourceName
value: "{{ ResourceName }}"
UPDATE examples
- update_backend_api
Updates an existing backend API resource.
UPDATE aws.amplifybackend.backend_apis
SET
ResourceConfig = '{{ ResourceConfig }}',
ResourceName = '{{ ResourceName }}'
WHERE
app_id = '{{ app_id }}' --required
AND backend_environment_name = '{{ backend_environment_name }}' --required
AND region = '{{ region }}' --required
AND ResourceName = '{{ ResourceName }}' --required
RETURNING
app_id,
backend_environment_name,
error,
job_id,
operation,
status;
DELETE examples
- delete_backend_api
Deletes an existing backend API resource.
DELETE FROM aws.amplifybackend.backend_apis
WHERE app_id = '{{ app_id }}' --required
AND backend_environment_name = '{{ backend_environment_name }}' --required
AND region = '{{ region }}' --required
;