Skip to main content

backends

Creates, updates, deletes, gets or lists a backends resource.

Overview

Namebackends
TypeResource
Idaws.amplifybackend.backends

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
amplify_feature_flagsstringA stringified version of the cli.json file for your Amplify project.
amplify_meta_configstringA stringified version of the current configs for your Amplify project.
app_idstringThe app ID.
app_namestringThe name of the app.
backend_environment_listarrayA list of backend environments in an array.
backend_environment_namestringThe name of the backend environment.
errorstringIf the request failed, this is the returned error.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_backendselectapp_id, regionProvides project-level details for your Amplify UI project.
create_backendinsertregion, AppId, AppName, BackendEnvironmentNameThis operation creates a backend for an Amplify app. Backends are automatically created at the time of app creation.
create_backend_configinsertapp_id, regionCreates a config object for a backend.
remove_all_backendsupdateapp_id, regionRemoves all backend environments from your Amplify project.
delete_backenddeleteapp_id, backend_environment_name, regionRemoves an existing environment from your Amplify project.
import_backend_authexecapp_id, backend_environment_name, region, NativeClientId, UserPoolId, WebClientIdImports an existing backend authentication resource.
import_backend_storageexecapp_id, backend_environment_name, region, ServiceNameImports an existing backend storage resource.
remove_backend_configexecapp_id, regionRemoves the AWS resources required to access the Amplify Admin UI.
update_backend_configexecapp_id, regionUpdates 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.

NameDatatypeDescription
app_idstringThe app ID.
backend_environment_namestringThe name of the backend environment.
regionstringAWS region (default: us-east-1)

SELECT examples

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

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
;

UPDATE examples

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

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

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 }}"
}'
;