Skip to main content

DynamoDB Create Table

The CreateTable operation adds a new table to your account. In an AWS account, table names must be unique within each Region. That is, you can have two tables with same name if you create the tables in different Regions.

CreateTable is an asynchronous operation. Upon receiving a CreateTable request, DynamoDB immediately returns a response with a TableStatus of CREATING. After the table is created, DynamoDB sets the TableStatus to ACTIVE. You can perform read and write operations only on an ACTIVE table.

You can optionally define secondary indexes on the new table, as part of the CreateTable operation. If you want to create multiple tables with secondary indexes on them, you must create the tables sequentially. Only one table with secondary indexes can be in the CREATING state at any given time.

You can use the DescribeTable action to check the table status.

External Documentation

To learn more, visit the AWS documentation.

Basic Parameters

ParameterDescription
AWS Region(s)Enter the desired AWS Region(s).To execute the action in multiple regions, provide a comma-separated list.For example: us-east-1,eu-west-2.If you wish to run the action in all available regions, use the asterisk symbol (*) instead.
Attribute DefinitionsAn array of attributes that describe the key schema for the table and indexes.
Key SchemaSpecifies the attributes that make up the primary key for a table or an index. The attributes in KeySchema must also be defined in the AttributeDefinitions array. For more information, see Data Model in the Amazon DynamoDB Developer Guide.Each KeySchemaElement in the array is composed of:
  • AttributeName - The name of this key attribute.
  • KeyType - The role that the key attribute will assume:
    • HASH - partition key
    • RANGE - sort key
The partition key of an item is also known as its hash attribute. The term "hash attribute" derives from the DynamoDB usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values.The sort key of an item is also known as its range attribute. The term "range attribute" derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.For a simple primary key (partition key), you must provide exactly one element with a KeyType of HASH.For a composite primary key (partition key and sort key), you must provide exactly two elements, in this order: The first element must have a KeyType of HASH, and the second element must have a KeyType of RANGE.For more information, see Working with Tables in the Amazon DynamoDB Developer Guide.
Table NameThe name of the table to create.

Advanced Parameters

ParameterDescription
Billing ModeControls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.
  • PROVISIONED - We recommend using PROVISIONED for predictable workloads. PROVISIONED sets the billing mode to Provisioned Mode.
  • PAY_PER_REQUEST - We recommend using PAY_PER_REQUEST for unpredictable workloads. PAY_PER_REQUEST sets the billing mode to On-Demand Mode.
Disable XML To JSON Auto ConvertWhen checked, XML responses are not automatically converted into JSON format.
Provisioned ThroughputRepresents the provisioned throughput settings for a specified table or index. The settings can be modified using the UpdateTable operation.For current minimum and maximum provisioned throughput values, see Service, Account, and Table Quotas in the Amazon DynamoDB Developer Guide.

Example Output

{
"TableDescription": {
"AttributeDefinitions": [
{
"AttributeName": "Artist",
"AttributeType": "S"
},
{
"AttributeName": "SongTitle",
"AttributeType": "S"
}
],
"CreationDateTime": "1421866952.062",
"ItemCount": 0,
"KeySchema": [
{
"AttributeName": "Artist",
"KeyType": "HASH"
},
{
"AttributeName": "SongTitle",
"KeyType": "RANGE"
}
],
"ProvisionedThroughput": {
"ReadCapacityUnits": 5,
"WriteCapacityUnits": 5
},
"TableName": "Music",
"TableSizeBytes": 0,
"TableStatus": "CREATING"
}
}

Workflow Library Example

Dynamodb Create Table with Aws and Send Results Via Email

Workflow LibraryPreview this Workflow on desktop