DynamoDb - Amazon Serverless Application Model
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

DynamoDb

Configure an Amazon DynamoDB table as a data source for your GraphQL API resolver.

Syntax

To declare this entity in your Amazon Serverless Application Model (Amazon 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

Amazon CloudFormation compatibility: This property is passed directly to the DeltaSyncConfig property of an AWS::AppSync::DataSource DynamoDBConfig object.

Description

The description of your data source.

Type: String

Required: No

Amazon CloudFormation compatibility: This property is passed directly to the Description property of an AWS::AppSync::DataSource resource.

LogicalId

The unique name of your data source.

Type: String

Required: Yes

Amazon CloudFormation compatibility: This property is passed directly to the Name property of an AWS::AppSync::DataSource resource.

Name

The name of your data source. Specify this property to override the LogicalId value.

Type: String

Required: No

Amazon CloudFormation compatibility: This property is passed directly to the Name property of an AWS::AppSync::DataSource resource.

Permissions

Provision permissions to your data source using Amazon 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.

Amazon SAM uses an AWS::Serverless::Connector resource which is transformed at deployment to provision your permissions. To learn about generated resources, see Amazon CloudFormation resources generated when you specify AWS::Serverless::Connector.

Note

You can specify Permissions or ServiceRoleArn, but not both. If neither are specified, Amazon SAM will generate default values of Read and Write. To revoke access to your data source, remove the DynamoDB object from your Amazon SAM template.

Type: List

Required: No

Amazon CloudFormation compatibility: This property is unique to Amazon SAM and doesn’t have an Amazon CloudFormation equivalent. It is similar to the Permissions property of an AWS::Serverless::Connector resource.

Region

The Amazon Web Services Region of your DynamoDB table. If you don’t specify it, Amazon SAM uses AWS::Region.

Type: String

Required: No

Amazon CloudFormation compatibility: This property is passed directly to the AwsRegion property of an AWS::AppSync::DataSource DynamoDBConfig object.

ServiceRoleArn

The Amazon 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 or ServiceRoleArn, but not both.

Type: String

Required: No. If not specified, Amazon SAM applies the default value for Permissions.

Amazon CloudFormation compatibility: This property is passed directly to the ServiceRoleArn property of an AWS::AppSync::DataSource resource.

TableArn

The ARN for the DynamoDB table.

Type: String

Required: Conditional. If you don’t specify ServiceRoleArn, TableArn is required.

Amazon CloudFormation compatibility: This property is unique to Amazon SAM and doesn’t have an Amazon CloudFormation equivalent.

TableName

The table name.

Type: String

Required: Yes

Amazon CloudFormation compatibility: This property is passed directly to the TableName property of an AWS::AppSync::DataSource DynamoDBConfig object.

UseCallerCredentials

Set to true to use IAM with this data source.

Type: Boolean

Required: No

Amazon CloudFormation compatibility: This property is passed directly to the UseCallerCredentials property of an AWS::AppSync::DataSource DynamoDBConfig object.

Versioned

Set to true to use Conflict Detection, Conflict Resolution, and Sync with this data source.

Type: Boolean

Required: No

Amazon CloudFormation compatibility: This property is passed directly to the Versioned property of an AWS::AppSync::DataSource DynamoDBConfig object.