Skip to content

Commit dd4a8af

Browse files
committed
Added script for creating dynamodb table
1 parent db778ec commit dd4a8af

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#! /bin/bash -e
2+
3+
aws dynamodb $* create-table --cli-input-json file://ftgo-order-history.json
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"TableName": "ftgo-order-history",
3+
"KeySchema": [
4+
{
5+
"KeyType": "HASH",
6+
"AttributeName": "orderId"
7+
}
8+
],
9+
"AttributeDefinitions": [
10+
{
11+
"AttributeName": "consumerId",
12+
"AttributeType": "S"
13+
},
14+
{
15+
"AttributeName": "creationDate",
16+
"AttributeType": "N"
17+
},
18+
{
19+
"AttributeName": "orderId",
20+
"AttributeType": "S"
21+
}
22+
],
23+
"GlobalSecondaryIndexes": [
24+
{
25+
"IndexName": "ftgo-order-history-by-consumer-id-and-creation-time",
26+
"Projection": {
27+
"ProjectionType": "ALL"
28+
},
29+
"ProvisionedThroughput": {
30+
"WriteCapacityUnits": 3,
31+
"ReadCapacityUnits": 3
32+
},
33+
"KeySchema": [
34+
{
35+
"KeyType": "HASH",
36+
"AttributeName": "consumerId"
37+
},
38+
{
39+
"KeyType": "RANGE",
40+
"AttributeName": "creationDate"
41+
}
42+
]
43+
}
44+
],
45+
"ProvisionedThroughput": {
46+
"WriteCapacityUnits": 3,
47+
"ReadCapacityUnits": 3
48+
}
49+
}

0 commit comments

Comments
 (0)