Skip to content

Instantly share code, notes, and snippets.

@kunduso
Last active March 12, 2023 11:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kunduso/cc445a7d9dccc6f0e6dc2f10af927852 to your computer and use it in GitHub Desktop.
Save kunduso/cc445a7d9dccc6f0e6dc2f10af927852 to your computer and use it in GitHub Desktop.
The aws cli to create a dynamodb table
# table name: Terraform-backend-lock
aws dynamodb create-table --table-name Terraform-backend-lock --attribute-definitions AttributeName=LockID,AttributeType=S --key-schema AttributeName=LockID,KeyType=HASH --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5
#output
{
"TableDescription": {
"AttributeDefinitions": [
{
"AttributeName": "LockID",
"AttributeType": "S"
}
],
"TableName": "Terraform-backend-lock",
"KeySchema": [
{
"AttributeName": "LockID",
"KeyType": "HASH"
}
],
"TableStatus": "CREATING",
"CreationDateTime": "2021-04-01T06:51:56.076000-05:00",
"ProvisionedThroughput": {
"NumberOfDecreasesToday": 0,
"ReadCapacityUnits": 5,
"WriteCapacityUnits": 5
},
"TableSizeBytes": 0,
"ItemCount": 0,
"TableArn": "arn:aws:dynamodb:us-east-2:$(AWSAccountNumber):table/Terraform-backend-lock",
"TableId": "9f2312ba-01ae-4f9a-9ea2-b179ffa780b2"
}
}
@aceqbaceq
Copy link

very very very thank you. your snippet is the only working solution for terraform+dynamodb !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment