-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
79 lines (68 loc) · 1.35 KB
/
main.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
provider "aws" {
region = "eu-west-1"
}
resource "random_pet" "this" {
length = 2
}
module "dynamodb_table" {
source = "../../"
name = "my-table-${random_pet.this.id}"
hash_key = "id"
range_key = "title"
billing_mode = "PROVISIONED"
read_capacity = 5
write_capacity = 5
autoscaling_read = {
scale_in_cooldown = 50
scale_out_cooldown = 40
target_value = 45
max_capacity = 10
}
autoscaling_write = {
scale_in_cooldown = 50
scale_out_cooldown = 40
target_value = 45
max_capacity = 10
}
autoscaling_indexes = {
TitleIndex = {
read_max_capacity = 30
read_min_capacity = 10
write_max_capacity = 30
write_min_capacity = 10
}
}
attributes = [
{
name = "id"
type = "N"
},
{
name = "title"
type = "S"
},
{
name = "age"
type = "N"
}
]
global_secondary_indexes = [
{
name = "TitleIndex"
hash_key = "title"
range_key = "age"
projection_type = "INCLUDE"
non_key_attributes = ["id"]
write_capacity = 10
read_capacity = 10
}
]
tags = {
Terraform = "true"
Environment = "staging"
}
}
module "disabled_dynamodb_table" {
source = "../../"
create_table = false
}