-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest-dynamodb-config.js
63 lines (63 loc) · 2.12 KB
/
jest-dynamodb-config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
module.exports = {
tables: [
{
TableName: `artists`,
KeySchema: [
{AttributeName: 'Album', KeyType: 'HASH'},
{AttributeName: 'Artist', KeyType: 'RANGE'}
],
AttributeDefinitions: [
{AttributeName: 'Album', AttributeType: 'S'},
{AttributeName: 'Artist', AttributeType: 'S'},
{AttributeName: 'Sales', AttributeType: 'N'},
{AttributeName: 'NumberOfSongs', AttributeType: 'N'}
],
ProvisionedThroughput: {ReadCapacityUnits: 1, WriteCapacityUnits: 1},
GlobalSecondaryIndexes: [
{
IndexName: 'myGSI',
KeySchema: [
{AttributeName: 'Sales', KeyType: 'HASH'},
{AttributeName: 'Artist', KeyType: 'RANGE'}
],
Projection: {
NonKeyAttributes: ['Album', 'NumberOfSongs'],
ProjectionType: 'INCLUDE'
},
ProvisionedThroughput: {
ReadCapacityUnits: 2,
WriteCapacityUnits: 2
}
},
{
IndexName: 'myGSI2',
KeySchema: [
{AttributeName: 'NumberOfSongs', KeyType: 'HASH'},
{AttributeName: 'Sales', KeyType: 'RANGE'}
],
Projection: {
NonKeyAttributes: ['Album', 'Artist'],
ProjectionType: 'INCLUDE'
},
ProvisionedThroughput: {
ReadCapacityUnits: 2,
WriteCapacityUnits: 2
}
}
],
LocalSecondaryIndexes: [
{
IndexName: 'myLSI',
KeySchema: [
{AttributeName: 'Album', KeyType: 'HASH'},
{AttributeName: 'Sales', KeyType: 'RANGE'}
],
Projection: {
NonKeyAttributes: ['Artist', 'NumberOfSongs'],
ProjectionType: 'INCLUDE'
}
}
]
}
]
};