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.
For more advanced features, use an AWS::DynamoDB::Table resource in AWS CloudFormation. These resouces can be used in AWS SAM. They are comprehensive and provide further customization, including key schema and resource policy customization.
Note
When you deploy to AWS CloudFormation, AWS SAM transforms your AWS SAM resources into AWS CloudFormation resources. For more information, see Generated AWS CloudFormation resources for AWS SAM.
Syntax
To declare this entity in your AWS Serverless Application Model (AWS SAM) template, use the following syntax.
YAML
Type: AWS::Serverless::SimpleTable Properties: PointInTimeRecoverySpecification:
PointInTimeRecoverySpecification
PrimaryKey:PrimaryKeyObject
ProvisionedThroughput:ProvisionedThroughput
SSESpecification:SSESpecification
TableName:String
Tags:Map
Properties
-
PointInTimeRecoverySpecification
-
The settings used to enable point in time recovery.
Type: PointInTimeRecoverySpecification
Required: No
AWS CloudFormation compatibility: This property is passed directly to the
PointInTimeRecoverySpecification
property of anAWS::DynamoDB::Table
resource. -
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 ofid
.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 specifiedBillingMode
will be specified asPAY_PER_REQUEST
.Type: ProvisionedThroughput
Required: No
AWS CloudFormation compatibility: This property is passed directly to the
ProvisionedThroughput
property of anAWS::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 anAWS::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 anAWS::DynamoDB::Table
resource. -
A map (string to string) that specifies the tags to be added to this SimpleTable. For details about valid keys and values for tags, see Resource tag in the AWS CloudFormation User Guide.
Type: Map
Required: No
AWS CloudFormation compatibility: This property is similar to the
Tags
property of anAWS::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