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.
To learn more, visit the AWS documentation.
Basic Parameters
Parameter | Description |
---|---|
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 Definitions | An array of attributes that describe the key schema for the table and indexes. |
Key Schema | Specifies 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:
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 Name | The name of the table to create. |
Advanced Parameters
Parameter | Description |
---|---|
Billing Mode | Controls how you are charged for read and write throughput and how you manage capacity. This setting can be changed later.
|
Disable XML To JSON Auto Convert | When checked, XML responses are not automatically converted into JSON format. |
Provisioned Throughput | Represents 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