AWS::AppSync::DataSourceThe `AWS::AppSync::DataSource` resource creates data sources for resolvers in AWS AppSync to connect to, such as Amazon DynamoDB , AWS Lambda , and Amazon OpenSearch Service . Resolvers use these data sources to fetch data when clients make GraphQL calls.
import { CfnDataSource } from 'aws-cdk-lib/aws-appsync';Or use the module namespace:
import * as appsync from 'aws-cdk-lib/aws-appsync';
// appsync.CfnDataSourceConfiguration passed to the constructor as CfnDataSourceProps.
apiIdRequiredstringUnique AWS AppSync GraphQL API identifier where this data source will be created.
nameRequiredstringFriendly name for you to identify your AppSync data source after creation.
typeRequiredstringThe type of the data source. - *AWS_LAMBDA* : The data source is an AWS Lambda function. - *AMAZON_DYNAMODB* : The data source is an Amazon DynamoDB table. - *AMAZON_ELASTICSEARCH* : The data source is an Amazon OpenSearch Service domain. - *AMAZON_EVENTBRIDGE* : The data source is an Amazon EventBridge event bus. - *AMAZON_OPENSEARCH_SERVICE* : The data source is an Amazon OpenSearch Service domain. - *AMAZON_BEDROCK_RUNTIME* : The data source is the Amazon Bedrock runtime. - *NONE* : There is no data source. This type is used when you wish to invoke a GraphQL operation without connecting to a data source, such as performing data transformation with resolvers or triggering a subscription to be invoked from a mutation. - *HTTP* : The data source is an HTTP endpoint. - *RELATIONAL_DATABASE* : The data source is a relational database.
descriptionOptionalstringThe description of the data source.
dynamoDbConfigOptionalIResolvable | DynamoDBConfigPropertyAWS Region and TableName for an Amazon DynamoDB table in your account.
elasticsearchConfigOptionalDeprecatedIResolvable | ElasticsearchConfigPropertyDeprecated: this property has been deprecated
eventBridgeConfigOptionalIResolvable | EventBridgeConfigPropertyAn EventBridge configuration that contains a valid ARN of an event bus.
httpConfigOptionalIResolvable | HttpConfigPropertyEndpoints for an HTTP data source.
lambdaConfigOptionalIResolvable | LambdaConfigPropertyAn 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.
metricsConfigOptionalstringEnables or disables enhanced data source metrics for specified data sources. Note that `MetricsConfig` won't be used unless the `dataSourceLevelMetricsBehavior` value is set to `PER_DATA_SOURCE_METRICS` . If the `dataSourceLevelMetricsBehavior` is set to `FULL_REQUEST_DATA_SOURCE_METRICS` instead, `MetricsConfig` will be ignored. However, you can still set its value. `MetricsConfig` can be `ENABLED` or `DISABLED` .
openSearchServiceConfigOptionalIResolvable | OpenSearchServiceConfigPropertyAWS Region and Endpoints for an Amazon OpenSearch Service domain in your account.
relationalDatabaseConfigOptionalIResolvable | RelationalDatabaseConfigPropertyRelational Database configuration of the relational database data source.
serviceRoleArnOptionalstring | IRoleRefThe AWS Identity and Access Management service role ARN for the data source. The system assumes this role when accessing the data source. Required if `Type` is specified as `AWS_LAMBDA` , `AMAZON_DYNAMODB` , `AMAZON_ELASTICSEARCH` , `AMAZON_EVENTBRIDGE` , `AMAZON_OPENSEARCH_SERVICE` , `RELATIONAL_DATABASE` , or `AMAZON_BEDROCK_RUNTIME` .
This L1 construct maps directly to the following CloudFormation resource type.
Everything you need to know about AWS AppSync on one page. HD quality, print-friendly.
Download Free Infographicaws-appsyncAWS::AppSync::DataSource