AWS CloudFormation
User Guide (API Version 2010-05-15)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Go to the Kindle Store to download this guide in Kindle format.Did this page help you?  Yes | No |  Tell us about it...

AWS::DynamoDB::Table

Creates an Amazon DynamoDB table.

Note

This resource does not support local secondary indexes.

Syntax

{
   "Type" : "AWS::DynamoDB::Table",
   "Properties" : {
      "KeySchema" : { DynamoDB Primary Key },
      "ProvisionedThroughput" : { DynamoDB Provisioned Throughput }
   }
}      
      

Properties

KeySchema

The primary key structure for the table, consisting of a required HashKeyElement and an optional RangeKeyElement, required only for composite primary keys. For more information about primary keys, see DynamoDB Primary Key.

Required: Yes

Type: DynamoDB Primary Key

Update requires: replacement

ProvisionedThroughput

New throughput for the specified table, consisting of values for ReadCapacityUnits and WriteCapacityUnits. For more information about the contents of a Provisioned Throughput structure, see DynamoDB Provisioned Throughput.

Required: Yes

Type: DynamoDB Provisioned Throughput

Update requires: replacement

Return Value

When the logical ID of this resource is provided to the Ref intrinsic function, it returns the resource name. For example:

{ "Ref": "MyResource" }

For the resource with the logical ID "MyResource", Ref will return the AWS resource name.

For more information about using the Ref function, see Ref.

Template Examples

Example Simple DynamoDB Template

{
   "AWSTemplateFormatVersion" : "2010-09-09",
   "Resources" : {
      "myDynamoDBTable" : {
         "Type" : "AWS::DynamoDB::Table",
         "Properties" : {
            "KeySchema" : {
               "HashKeyElement": {
                  "AttributeName" : "AttributeName1",
                  "AttributeType" : "S"
               },
               "RangeKeyElement" : {
                  "AttributeName" : "AttributeName2",
                  "AttributeType" : "N"
               }
            },
            "ProvisionedThroughput" : {
               "ReadCapacityUnits" : "5",
               "WriteCapacityUnits" : "10"
            }
         }
      }
   }
}