Skip to main content

backend_apis

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

Overview

Namebackend_apis
TypeResource
Idaws.amplifybackend.backend_apis

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
app_idstringThe app ID.
backend_environment_namestringThe name of the backend environment.
errorstringIf the request fails, this error is returned.
resource_configobjectThe resource config for the data model, configured as a part of the Amplify project.
resource_namestringThe name of this resource.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_backend_apiselectapp_id, backend_environment_name, regionGets the details for a backend API.
create_backend_apiinsertapp_id, region, BackendEnvironmentName, ResourceConfig, ResourceNameCreates a new backend API resource.
update_backend_apiupdateapp_id, backend_environment_name, region, ResourceNameUpdates an existing backend API resource.
delete_backend_apideleteapp_id, backend_environment_name, regionDeletes 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.

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

SELECT examples

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

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
;

UPDATE examples

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

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
;