AWS::Serverless::SimpleTable - AWS Serverless Application Model

AWS::Serverless::SimpleTable

Creates a DynamoDB table with a single attribute primary key. It is useful when data only needs to be accessed via a primary key.

To use the more advanced functionality of DynamoDB, use an AWS::DynamoDB::Table resource instead.

Syntax

To declare this entity in your AWS Serverless Application Model (AWS SAM) template, use the following syntax.

YAML

Type: AWS::Serverless::SimpleTable Properties: PrimaryKey: PrimaryKeyObject ProvisionedThroughput: ProvisionedThroughput SSESpecification: SSESpecification TableName: String Tags: Map

Properties

PrimaryKey

Attribute name and type to be used as the table's primary key. If not provided, the primary key will be a String with a value of id.

Note: The value of this property cannot be modified after this resource is created.

Type: PrimaryKeyObject

Required: No

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

ProvisionedThroughput

Read and write throughput provisioning information.

If ProvisionedThroughput is not specified BillingMode will be specified as PAY_PER_REQUEST.

Type: ProvisionedThroughput

Required: No

AWS CloudFormation compatibility: This property is passed directly to the ProvisionedThroughput property of an AWS::DynamoDB::Table resource.

SSESpecification

Specifies the settings to enable server-side encryption.

Type: SSESpecification

Required: No

AWS CloudFormation compatibility: This property is passed directly to the SSESpecification property of an AWS::DynamoDB::Table resource.

TableName

Name for the DynamoDB Table.

Type: String

Required: No

AWS CloudFormation compatibility: This property is passed directly to the TableName property of an AWS::DynamoDB::Table resource.

Tags

A map (string to string) that specifies the tags to be added to this SimpleTable. Keys and values are limited to alphanumeric characters. Keys can be 1 to 127 Unicode characters in length and cannot be prefixed with aws:. Values can be 1 to 255 Unicode characters in length.

Type: Map

Required: No

AWS CloudFormation compatibility: This property is similar to the Tags property of an AWS::DynamoDB::Table resource. The Tags property in SAM consists of Key:Value pairs; in CloudFormation it consists of a list of Tag objects.

Return Values

Ref

When the logical ID of this resource is provided to the Ref intrinsic function, it returns the resource name of the underlying DynamoDB table.

For more information about using the Ref function, see Ref in the AWS CloudFormation User Guide.

Examples

SimpleTableExample

Example of a SimpleTable

YAML

Properties: TableName: my-table Tags: Department: Engineering AppType: Serverless