DynamoDb
Configure an Amazon DynamoDB table as a data source for your GraphQL API resolver.
Syntax
To declare this entity in your AWS Serverless Application Model (AWS SAM) template, use the following syntax.
YAML
LogicalId
: DeltaSync:DeltaSyncConfig
Description:String
Name:String
Permissions:List
Region:String
ServiceRoleArn:String
TableArn:String
TableName:String
UseCallerCredentials:Boolean
Versioned:Boolean
Properties
DeltaSync
-
Describes a Delta Sync configuration.
Type: DeltaSyncConfig
Required: No
AWS CloudFormation compatibility: This property is passed directly to the
DeltaSyncConfig
property of anAWS::AppSync::DataSource DynamoDBConfig
object. Description
-
The description of your data source.
Type: String
Required: No
AWS CloudFormation compatibility: This property is passed directly to the
Description
property of anAWS::AppSync::DataSource
resource. LogicalId
-
The unique name of your data source.
Type: String
Required: Yes
AWS CloudFormation compatibility: This property is passed directly to the
Name
property of anAWS::AppSync::DataSource
resource. Name
-
The name of your data source. Specify this property to override the
LogicalId
value.Type: String
Required: No
AWS CloudFormation compatibility: This property is passed directly to the
Name
property of anAWS::AppSync::DataSource
resource. Permissions
-
Provision permissions to your data source using AWS SAM connectors. You can provide any of the following values in a list:
-
Read
– Allow your resolver to read your data source. -
Write
– Allow your resolver to write to your data source.
AWS SAM uses an
AWS::Serverless::Connector
resource which is transformed at deployment to provision your permissions. To learn about generated resources, see AWS CloudFormation resources generated when you specify AWS::Serverless::Connector.Note
You can specify
Permissions
orServiceRoleArn
, but not both. If neither are specified, AWS SAM will generate default values ofRead
andWrite
. To revoke access to your data source, remove the DynamoDB object from your AWS SAM template.Type: List
Required: No
AWS CloudFormation compatibility: This property is unique to AWS SAM and doesn’t have an AWS CloudFormation equivalent. It is similar to the
Permissions
property of anAWS::Serverless::Connector
resource. -
Region
-
The AWS Region of your DynamoDB table. If you don’t specify it, AWS SAM uses
AWS::Region
.Type: String
Required: No
AWS CloudFormation compatibility: This property is passed directly to the
AwsRegion
property of anAWS::AppSync::DataSource DynamoDBConfig
object. ServiceRoleArn
-
The AWS Identity and Access Management (IAM) service role ARN for the data source. The system assumes this role when accessing the data source.
You can specify
Permissions
orServiceRoleArn
, but not both.Type: String
Required: No. If not specified, AWS SAM applies the default value for
Permissions
.AWS CloudFormation compatibility: This property is passed directly to the
ServiceRoleArn
property of anAWS::AppSync::DataSource
resource. TableArn
-
The ARN for the DynamoDB table.
Type: String
Required: Conditional. If you don’t specify
ServiceRoleArn
,TableArn
is required.AWS CloudFormation compatibility: This property is unique to AWS SAM and doesn’t have an AWS CloudFormation equivalent.
TableName
-
The table name.
Type: String
Required: Yes
AWS CloudFormation compatibility: This property is passed directly to the
TableName
property of anAWS::AppSync::DataSource DynamoDBConfig
object. UseCallerCredentials
-
Set to
true
to use IAM with this data source.Type: Boolean
Required: No
AWS CloudFormation compatibility: This property is passed directly to the
UseCallerCredentials
property of anAWS::AppSync::DataSource DynamoDBConfig
object. Versioned
-
Set to
true
to use Conflict Detection, Conflict Resolution, and Sync with this data source.Type: Boolean
Required: No
AWS CloudFormation compatibility: This property is passed directly to the
Versioned
property of anAWS::AppSync::DataSource DynamoDBConfig
object.