Create Table

POST {{aws_dynamodb_base_url}}/?Action=CreateTable

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.

Request Params

KeyDatatypeRequiredDescription
ActionstringAn array of attributes that describe the key schema for the table and indexes.

Request Body

{"AttributeDefinitions"=>[{"AttributeName"=>"ForumName", "AttributeType"=>"S"}, {"AttributeName"=>"Subject", "AttributeType"=>"S"}, {"AttributeName"=>"LastPostDateTime", "AttributeType"=>"S"}], "TableName"=>"Thread", "KeySchema"=>[{"AttributeName"=>"ForumName", "KeyType"=>"HASH"}, {"AttributeName"=>"Subject", "KeyType"=>"RANGE"}], "LocalSecondaryIndexes"=>[{"IndexName"=>"LastPostIndex", "KeySchema"=>[{"AttributeName"=>"ForumName", "KeyType"=>"HASH"}, {"AttributeName"=>"LastPostDateTime", "KeyType"=>"RANGE"}], "Projection"=>{"ProjectionType"=>"KEYS_ONLY"}}], "ProvisionedThroughput"=>{"ReadCapacityUnits"=>5, "WriteCapacityUnits"=>5}, "Tags"=>[{"Key"=>"Owner", "Value"=>"BlueTeam"}]}

HEADERS

KeyDatatypeRequiredDescription
X-Amz-Targetstring
Content-Typestring

RESPONSES

status: OK

{"TableDescription":{"AttributeDefinitions":[{"AttributeName":"ForumName","AttributeType":"S"},{"AttributeName":"LastPostDateTime","AttributeType":"S"},{"AttributeName":"Subject","AttributeType":"S"}],"CreationDateTime":1574831102.349,"ItemCount":0,"KeySchema":[{"AttributeName":"ForumName","KeyType":"HASH"},{"AttributeName":"Subject","KeyType":"RANGE"}],"LocalSecondaryIndexes":[{"IndexArn":"arn:aws:dynamodb:us-east-1:879370021840:table/Thread/index/LastPostIndex","IndexName":"LastPostIndex","IndexSizeBytes":0,"ItemCount":0,"KeySchema":[{"AttributeName":"ForumName","KeyType":"HASH"},{"AttributeName":"LastPostDateTime","KeyType":"RANGE"}],"Projection":{"ProjectionType":"KEYS_ONLY"}}],"ProvisionedThroughput":{"NumberOfDecreasesToday":0,"ReadCapacityUnits":5,"WriteCapacityUnits":5},"TableArn":"arn:aws:dynamodb:us-east-1:879370021840:table/Thread","TableId":"43fce991-2bb5-4e44-b34c-6c5dbcee50e4","TableName":"Thread","TableSizeBytes":0,"TableStatus":"CREATING"}}