data_sources
Creates, updates, deletes or gets a data_source
resource or lists data_sources
in a region
Overview
Name | data_sources |
Type | Resource |
Description | Resource Type definition for AWS::AppSync::DataSource |
Id | aws.appsync.data_sources |
Fields
Name | Datatype | Description |
---|---|---|
api_id | string | Unique AWS AppSync GraphQL API identifier where this data source will be created. |
description | string | The description of the data source. |
dynamo_db_config | object | AWS Region and TableName for an Amazon DynamoDB table in your account. |
elasticsearch_config | object | AWS Region and Endpoints for an Amazon OpenSearch Service domain in your account. 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_config | object | ARN for the EventBridge bus. |
http_config | object | Endpoints for an HTTP data source. |
lambda_config | object | An 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. |
name | string | Friendly name for you to identify your AppSync data source after creation. |
open_search_service_config | object | AWS Region and Endpoints for an Amazon OpenSearch Service domain in your account. |
relational_database_config | object | Relational Database configuration of the relational database data source. |
service_role_arn | string | The AWS Identity and Access Management service role ARN for the data source. The system assumes this role when accessing the data source. |
type | string | The type of the data source. |
data_source_arn | string | The Amazon Resource Name (ARN) of the API key, such as arn:aws:appsync:us-east-1:123456789012:apis/graphqlapiid/datasources/datasourcename. |
metrics_config | string | |
region | string | AWS region. |
For more information, see AWS::AppSync::DataSource
.
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | Type, ApiId, Name, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all data_sources
in a region.
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 aws.appsync.data_sources
WHERE region = 'us-east-1';
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 aws.appsync.data_sources
WHERE region = 'us-east-1' AND data__Identifier = '<DataSourceArn>';
INSERT
example
Use the following StackQL query and manifest file to create a new data_source
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.appsync.data_sources (
ApiId,
Name,
Type,
region
)
SELECT
'{{ ApiId }}',
'{{ Name }}',
'{{ Type }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.appsync.data_sources (
ApiId,
Description,
DynamoDBConfig,
ElasticsearchConfig,
EventBridgeConfig,
HttpConfig,
LambdaConfig,
Name,
OpenSearchServiceConfig,
RelationalDatabaseConfig,
ServiceRoleArn,
Type,
MetricsConfig,
region
)
SELECT
'{{ ApiId }}',
'{{ Description }}',
'{{ DynamoDBConfig }}',
'{{ ElasticsearchConfig }}',
'{{ EventBridgeConfig }}',
'{{ HttpConfig }}',
'{{ LambdaConfig }}',
'{{ Name }}',
'{{ OpenSearchServiceConfig }}',
'{{ RelationalDatabaseConfig }}',
'{{ ServiceRoleArn }}',
'{{ Type }}',
'{{ MetricsConfig }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: data_source
props:
- name: ApiId
value: '{{ ApiId }}'
- name: Description
value: '{{ Description }}'
- name: DynamoDBConfig
value:
TableName: '{{ TableName }}'
DeltaSyncConfig:
BaseTableTTL: '{{ BaseTableTTL }}'
DeltaSyncTableTTL: '{{ DeltaSyncTableTTL }}'
DeltaSyncTableName: '{{ DeltaSyncTableName }}'
UseCallerCredentials: '{{ UseCallerCredentials }}'
AwsRegion: '{{ AwsRegion }}'
Versioned: '{{ Versioned }}'
- name: ElasticsearchConfig
value:
AwsRegion: '{{ AwsRegion }}'
Endpoint: '{{ Endpoint }}'
- name: EventBridgeConfig
value:
EventBusArn: '{{ EventBusArn }}'
- name: HttpConfig
value:
Endpoint: '{{ Endpoint }}'
AuthorizationConfig:
AuthorizationType: '{{ AuthorizationType }}'
AwsIamConfig:
SigningRegion: '{{ SigningRegion }}'
SigningServiceName: '{{ SigningServiceName }}'
- name: LambdaConfig
value:
LambdaFunctionArn: '{{ LambdaFunctionArn }}'
- name: Name
value: '{{ Name }}'
- name: OpenSearchServiceConfig
value:
AwsRegion: '{{ AwsRegion }}'
Endpoint: '{{ Endpoint }}'
- name: RelationalDatabaseConfig
value:
RdsHttpEndpointConfig:
DatabaseName: '{{ DatabaseName }}'
AwsRegion: '{{ AwsRegion }}'
DbClusterIdentifier: '{{ DbClusterIdentifier }}'
AwsSecretStoreArn: '{{ AwsSecretStoreArn }}'
Schema: '{{ Schema }}'
RelationalDatabaseSourceType: '{{ RelationalDatabaseSourceType }}'
- name: ServiceRoleArn
value: '{{ ServiceRoleArn }}'
- name: Type
value: '{{ Type }}'
- name: MetricsConfig
value: '{{ MetricsConfig }}'
DELETE
example
/*+ delete */
DELETE FROM aws.appsync.data_sources
WHERE data__Identifier = '<DataSourceArn>'
AND region = 'us-east-1';
Permissions
To operate on the data_sources
resource, the following permissions are required:
Create
appsync:CreateDataSource,
appsync:GetDataSource,
iam:PassRole
Read
appsync:GetDataSource
Update
appsync:UpdateDataSource,
iam:PassRole
Delete
appsync:DeleteDataSource,
appsync:GetDataSource
List
appsync:ListDataSources