backends
Creates, updates, deletes, gets or lists a backends resource.
Overview
| Name | backends |
| Type | Resource |
| Id | aws.amplifybackend.backends |
Fields
The following fields are returned by SELECT queries:
- get_backend
| Name | Datatype | Description |
|---|---|---|
amplify_feature_flags | string | A stringified version of the cli.json file for your Amplify project. |
amplify_meta_config | string | A stringified version of the current configs for your Amplify project. |
app_id | string | The app ID. |
app_name | string | The name of the app. |
backend_environment_list | array | A list of backend environments in an array. |
backend_environment_name | string | The name of the backend environment. |
error | string | If the request failed, this is the returned error. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_backend | select | app_id, region | Provides project-level details for your Amplify UI project. | |
create_backend | insert | region, AppId, AppName, BackendEnvironmentName | This operation creates a backend for an Amplify app. Backends are automatically created at the time of app creation. | |
create_backend_config | insert | app_id, region | Creates a config object for a backend. | |
remove_all_backends | update | app_id, region | Removes all backend environments from your Amplify project. | |
delete_backend | delete | app_id, backend_environment_name, region | Removes an existing environment from your Amplify project. | |
import_backend_auth | exec | app_id, backend_environment_name, region, NativeClientId, UserPoolId, WebClientId | Imports an existing backend authentication resource. | |
import_backend_storage | exec | app_id, backend_environment_name, region, ServiceName | Imports an existing backend storage resource. | |
remove_backend_config | exec | app_id, region | Removes the AWS resources required to access the Amplify Admin UI. | |
update_backend_config | exec | app_id, region | Updates the AWS resources required to access the Amplify Admin UI. |
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
Provides project-level details for your Amplify UI project.
SELECT
amplify_feature_flags,
amplify_meta_config,
app_id,
app_name,
backend_environment_list,
backend_environment_name,
error
FROM aws.amplifybackend.backends
WHERE app_id = '{{ app_id }}' -- required
AND region = '{{ region }}' -- required
;
INSERT examples
- create_backend
- create_backend_config
- Manifest
This operation creates a backend for an Amplify app. Backends are automatically created at the time of app creation.
INSERT INTO aws.amplifybackend.backends (
AppId,
AppName,
BackendEnvironmentName,
ResourceConfig,
ResourceName,
region
)
SELECT
'{{ AppId }}' /* required */,
'{{ AppName }}' /* required */,
'{{ BackendEnvironmentName }}' /* required */,
'{{ ResourceConfig }}',
'{{ ResourceName }}',
'{{ region }}'
RETURNING
app_id,
backend_environment_name,
error,
job_id,
operation,
status
;
Creates a config object for a backend.
INSERT INTO aws.amplifybackend.backends (
BackendManagerAppId,
app_id,
region
)
SELECT
'{{ BackendManagerAppId }}',
'{{ app_id }}',
'{{ region }}'
RETURNING
app_id,
backend_environment_name,
job_id,
status
;
# Description fields are for documentation purposes
- name: backends
props:
- name: region
value: "{{ region }}"
description: Required parameter for the backends resource.
- name: app_id
value: "{{ app_id }}"
description: Required parameter for the backends resource.
- name: AppId
value: "{{ AppId }}"
- name: AppName
value: "{{ AppName }}"
- name: BackendEnvironmentName
value: "{{ BackendEnvironmentName }}"
- name: ResourceConfig
value: "{{ ResourceConfig }}"
description: |
Defines the resource configuration for the data model in your Amplify project.
- name: ResourceName
value: "{{ ResourceName }}"
- name: BackendManagerAppId
value: "{{ BackendManagerAppId }}"
UPDATE examples
- remove_all_backends
Removes all backend environments from your Amplify project.
UPDATE aws.amplifybackend.backends
SET
CleanAmplifyApp = {{ CleanAmplifyApp }}
WHERE
app_id = '{{ app_id }}' --required
AND region = '{{ region }}' --required
RETURNING
app_id,
error,
job_id,
operation,
status;
DELETE examples
- delete_backend
Removes an existing environment from your Amplify project.
DELETE FROM aws.amplifybackend.backends
WHERE app_id = '{{ app_id }}' --required
AND backend_environment_name = '{{ backend_environment_name }}' --required
AND region = '{{ region }}' --required
;
Lifecycle Methods
- import_backend_auth
- import_backend_storage
- remove_backend_config
- update_backend_config
Imports an existing backend authentication resource.
EXEC aws.amplifybackend.backends.import_backend_auth
@app_id='{{ app_id }}' --required,
@backend_environment_name='{{ backend_environment_name }}' --required,
@region='{{ region }}' --required
@@json=
'{
"IdentityPoolId": "{{ IdentityPoolId }}",
"NativeClientId": "{{ NativeClientId }}",
"UserPoolId": "{{ UserPoolId }}",
"WebClientId": "{{ WebClientId }}"
}'
;
Imports an existing backend storage resource.
EXEC aws.amplifybackend.backends.import_backend_storage
@app_id='{{ app_id }}' --required,
@backend_environment_name='{{ backend_environment_name }}' --required,
@region='{{ region }}' --required
@@json=
'{
"BucketName": "{{ BucketName }}",
"ServiceName": "{{ ServiceName }}"
}'
;
Removes the AWS resources required to access the Amplify Admin UI.
EXEC aws.amplifybackend.backends.remove_backend_config
@app_id='{{ app_id }}' --required,
@region='{{ region }}' --required
;
Updates the AWS resources required to access the Amplify Admin UI.
EXEC aws.amplifybackend.backends.update_backend_config
@app_id='{{ app_id }}' --required,
@region='{{ region }}' --required
@@json=
'{
"LoginAuthConfig": "{{ LoginAuthConfig }}"
}'
;