Skip to main content

data_sources

Creates, updates, deletes or gets a data_source resource or lists data_sources in a region

Overview

Namedata_sources
TypeResource
DescriptionResource Type definition for AWS::AppSync::DataSource
Idawscc.appsync.data_sources

Fields

NameDatatypeDescription
api_idstringUnique AWS AppSync GraphQL API identifier where this data source will be created.
descriptionstringThe description of the data source.
dynamo_db_configobjectAWS Region and TableName for an Amazon DynamoDB table in your account.
elasticsearch_configobjectAWS Region and Endpoints for an Amazon OpenSearch Service domain in your account.<br />As of September 2021, Amazon Elasticsearch Service is Amazon OpenSearch Service. This property is deprecated. For new data sources, use OpenSearchServiceConfig to specify an OpenSearch Service data source.
event_bridge_configobjectARN for the EventBridge bus.
http_configobjectEndpoints for an HTTP data source.
lambda_configobjectAn ARN of a Lambda function in valid ARN format. This can be the ARN of a Lambda function that exists in the current account or in another account.
namestringFriendly name for you to identify your AppSync data source after creation.
open_search_service_configobjectAWS Region and Endpoints for an Amazon OpenSearch Service domain in your account.
relational_database_configobjectRelational Database configuration of the relational database data source.
service_role_arnstringThe AWS Identity and Access Management service role ARN for the data source. The system assumes this role when accessing the data source.
typestringThe type of the data source.
data_source_arnstringThe Amazon Resource Name (ARN) of the API key, such as arn:aws:appsync:us-east-1:123456789012:apis/graphqlapiid/datasources/datasourcename.
metrics_configstring
regionstringAWS region.

For more information, see AWS::AppSync::DataSource.

Methods

NameResourceAccessible byRequired Params
create_resourcedata_sourcesINSERTType, ApiId, Name, region
delete_resourcedata_sourcesDELETEIdentifier, region
update_resourcedata_sourcesUPDATEIdentifier, PatchDocument, region
list_resourcesdata_sources_list_onlySELECTregion
get_resourcedata_sourcesSELECTIdentifier, region

SELECT examples

Gets all properties from an individual data_source.

SELECT
region,
api_id,
description,
dynamo_db_config,
elasticsearch_config,
event_bridge_config,
http_config,
lambda_config,
name,
open_search_service_config,
relational_database_config,
service_role_arn,
type,
data_source_arn,
metrics_config
FROM awscc.appsync.data_sources
WHERE
region = 'us-east-1' AND
Identifier = '{{ data_source_arn }}';

INSERT example

Use the following StackQL query and manifest file to create a new data_source resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.appsync.data_sources (
ApiId,
Name,
Type,
region
)
SELECT
'{{ api_id }}',
'{{ name }}',
'{{ type }}',
'{{ region }}';

UPDATE example

Use the following StackQL query and manifest file to update a data_source resource, using stack-deploy.

/*+ update */
UPDATE awscc.appsync.data_sources
SET PatchDocument = string('{{ {
"Description": description,
"DynamoDBConfig": dynamo_db_config,
"ElasticsearchConfig": elasticsearch_config,
"EventBridgeConfig": event_bridge_config,
"HttpConfig": http_config,
"LambdaConfig": lambda_config,
"OpenSearchServiceConfig": open_search_service_config,
"RelationalDatabaseConfig": relational_database_config,
"ServiceRoleArn": service_role_arn,
"Type": type,
"MetricsConfig": metrics_config
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ data_source_arn }}';

DELETE example

/*+ delete */
DELETE FROM awscc.appsync.data_sources
WHERE
Identifier = '{{ data_source_arn }}' AND
region = 'us-east-1';

Permissions

To operate on the data_sources resource, the following permissions are required:

appsync:CreateDataSource,
appsync:GetDataSource,
iam:PassRole