Last active
September 24, 2018 13:06
-
-
Save crissilvaeng/7620d6681d6b1741e8112986e29d46bb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"AttributeDefinitions": [ | |
{ | |
"AttributeName": "birth_day", | |
"AttributeType": "N" | |
}, | |
{ | |
"AttributeName": "birth_month", | |
"AttributeType": "N" | |
}, | |
{ | |
"AttributeName": "friend_id", | |
"AttributeType": "N" | |
} | |
], | |
"TableName": "Friends3", | |
"KeySchema": [ | |
{ | |
"AttributeName": "friend_id", | |
"KeyType": "HASH" | |
} | |
], | |
"ProvisionedThroughput": { | |
"ReadCapacityUnits": 5, | |
"WriteCapacityUnits": 2 | |
}, | |
"GlobalSecondaryIndexes": [ | |
{ | |
"IndexName": "birthday-index", | |
"KeySchema": [ | |
{ | |
"AttributeName": "birth_month", | |
"KeyType": "HASH" | |
}, | |
{ | |
"AttributeName": "birth_day", | |
"KeyType": "RANGE" | |
} | |
], | |
"Projection": { | |
"ProjectionType": "ALL" | |
}, | |
"ProvisionedThroughput": { | |
"ReadCapacityUnits": 5, | |
"WriteCapacityUnits": 2 | |
} | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws dynamodb create-table \ | |
--attribute-definitions AttributeName=birth_day,AttributeType=N AttributeName=birth_month,AttributeType=N AttributeName=friend_id,AttributeType=N \ | |
--table-name Friends \ | |
--key-schema AttributeName=friend_id,KeyType=HASH \ | |
--global-secondary-indexes IndexName=birthday-index,KeySchema=[{AttributeName=birth_month,KeyType=HASH},{AttributeName=birth_day,KeyType=RANGE}],Projection={ProjectionType=ALL},ProvisionedThroughput={ReadCapacityUnits=5,WriteCapacityUnits=2} \ | |
--provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment