AWS AppSync Datasource
This page shows how to write Terraform and CloudFormation for AWS AppSync Datasource and write them securely.
aws_appsync_datasource (Terraform)
The Datasource in AWS AppSync can be configured in Terraform with the resource name aws_appsync_datasource. The following sections describe 1 example of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_appsync_datasource" "poc_ds_person" {
api_id = aws_appsync_graphql_api.poc_appsync_api.id
name = "ds_person"
service_role_arn = aws_iam_role.appsync_api.arn
type = "AMAZON_DYNAMODB"
Parameters
-
api_idrequired - string -
arnoptional computed - string -
descriptionoptional - string -
idoptional computed - string -
namerequired - string -
service_role_arnoptional - string -
typerequired - string -
dynamodb_configlist block-
regionoptional computed - string -
table_namerequired - string -
use_caller_credentialsoptional - bool
-
-
elasticsearch_configlist block -
http_configlist block-
endpointrequired - string
-
-
lambda_configlist block-
function_arnrequired - string
-
Explanation in Terraform Registry
Provides an AppSync DataSource.
AWS::AppSync::DataSource (CloudFormation)
The DataSource in AppSync can be configured in CloudFormation with the resource name AWS::AppSync::DataSource. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
-
Typerequired - String -
OpenSearchServiceConfigoptional - OpenSearchServiceConfig -
Descriptionoptional - String -
ServiceRoleArnoptional - String -
HttpConfigoptional - HttpConfig -
RelationalDatabaseConfigoptional - RelationalDatabaseConfig -
LambdaConfigoptional - LambdaConfig -
ApiIdrequired - String -
Namerequired - String -
DynamoDBConfigoptional - DynamoDBConfig -
ElasticsearchConfigoptional - ElasticsearchConfig
Explanation in CloudFormation Registry
The
AWS::AppSync::DataSourceresource 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.
Frequently asked questions
What is AWS AppSync Datasource?
AWS AppSync Datasource is a resource for AppSync of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS AppSync Datasource?
For Terraform, the jjoc007/poc-appsync-golang-mongo source code example is useful. See the Terraform Example section for further details.