-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathdynamodb.tf
49 lines (41 loc) · 811 Bytes
/
dynamodb.tf
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
resource "aws_dynamodb_table" "events" {
name = "events"
billing_mode = "PAY_PER_REQUEST"
hash_key = "id"
attribute {
name = "id"
type = "S"
}
ttl {
attribute_name = "expire"
enabled = true
}
}
resource "aws_dynamodb_table" "questions" {
name = "questions"
billing_mode = "PAY_PER_REQUEST"
hash_key = "id"
attribute {
name = "id"
type = "S"
}
attribute {
name = "eid"
type = "S"
}
attribute {
name = "votes"
type = "N"
}
ttl {
attribute_name = "expire"
enabled = true
}
global_secondary_index {
name = "top"
hash_key = "eid"
range_key = "votes"
projection_type = "INCLUDE"
non_key_attributes = ["answered", "hidden"]
}
}