/
dynamodb_table_create.rb
57 lines (57 loc) · 1.33 KB
/
dynamodb_table_create.rb
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
aws_dynamodb_table 'test-dynamodb-table' do
aws_access_key node['aws_test']['key_id']
aws_secret_access_key node['aws_test']['access_key']
action :create
attribute_definitions [
{ attribute_name: 'Id', attribute_type: 'N' },
{ attribute_name: 'Foo', attribute_type: 'N' },
{ attribute_name: 'Bar', attribute_type: 'N' },
{ attribute_name: 'Baz', attribute_type: 'S' },
]
key_schema [
{ attribute_name: 'Id', key_type: 'HASH' },
{ attribute_name: 'Foo', key_type: 'RANGE' },
]
local_secondary_indexes [
{
index_name: 'BarIndex',
key_schema: [
{
attribute_name: 'Id',
key_type: 'HASH',
},
{
attribute_name: 'Bar',
key_type: 'RANGE',
},
],
projection: {
projection_type: 'ALL',
},
},
]
global_secondary_indexes [
{
index_name: 'BazIndex',
key_schema: [{
attribute_name: 'Baz',
key_type: 'HASH',
}],
projection: {
projection_type: 'ALL',
},
provisioned_throughput: {
read_capacity_units: 2,
write_capacity_units: 2,
},
},
]
provisioned_throughput ({
read_capacity_units: 2,
write_capacity_units: 2,
})
stream_specification ({
stream_enabled: true,
stream_view_type: 'KEYS_ONLY',
})
end