| « PreviousNext » | |
![]() ![]() ![]() | Did this page help you? Yes | No | Tell us about it... |
Describes an Amazon DynamoDB primary key for an AWS::DynamoDB::Table resource.
There are two types of primary key types: hash type primary keys, and hash and range type primary keys:
A hash type primary key creates a table that has an unordered hash index based on the
AttributeName of the HashKeyElement.
A hash and range type primary key creates a table that has both an unordered hash index based on the
AttributeName of the HashKeyElement, and an ordered hash
index based on the AttributeName of the RangeKeyElement.
For a complete discussion of Amazon DynamoDB primary keys, see Primary Key in the Amazon DynamoDB Developer Guide.
{
"HashKeyElement": {
"AttributeName" : String,
"AttributeType" : String
},
"RangeKeyElement" : {
"AttributeName" : String,
"AttributeType" : String
}
}Each element type has an AttributeName and AttributeType, defined as follows:
The name of the attribute that will serve as the primary key for this table. Primary key element names can be 1 – 255 characters long and have no character restrictions.
Required: Yes
Type: String
The type of this attribute. This must be either "S" for string data, or "N" for numeric data.
Required: Yes
Type: String
Note
For detailed information about the limits of primary key values in Amazon DynamoDB, see Limits in Amazon DynamoDB in the Amazon DynamoDB Developer Guide.
For an example of a declared primary key, see AWS::DynamoDB::Table.