-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.tf
219 lines (175 loc) · 5.58 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
### Stockholm nodes and load-balancer ###
module "nodes_api_main_stockholm" {
source = "github.com/aeternity/terraform-aws-aenode-deploy?ref=v4.0.0"
env = "api_main"
static_nodes = 0
spot_nodes_min = 2
spot_nodes_max = 20
instance_type = "c6i.xlarge"
instance_types = ["c6i.xlarge", "c5d.xlarge", "c5.xlarge", "c7i.xlarge"]
ami_name = "aeternity-ubuntu-22.04-v1720022468"
root_volume_size = 24
additional_storage = true
additional_storage_size = 500
asg_target_groups = module.lb_main_stockholm.target_groups
tags = {
role = "aenode"
env = "api_main"
envid = "api_main"
}
config_tags = {
bootstrap_version = var.bootstrap_version
vault_role = "ae-node"
vault_addr = var.vault_addr
bootstrap_config = "secret2/aenode/config/api_main"
}
providers = {
aws = aws.eu-north-1
}
}
module "nodes_api_main_stockholm_channels" {
source = "github.com/aeternity/terraform-aws-aenode-deploy?ref=v4.0.0"
env = "api_main"
static_nodes = 1
spot_nodes_min = 0
spot_nodes_max = 0
instance_type = "t3.large"
instance_types = ["t3.large", "c5.large", "m5.large"]
ami_name = "aeternity-ubuntu-22.04-v1709639419"
root_volume_size = 40
additional_storage = true
additional_storage_size = 200
asg_target_groups = module.lb_main_stockholm.target_groups_channels
subnets = module.nodes_api_main_stockholm.subnets
vpc_id = module.nodes_api_main_stockholm.vpc_id
enable_state_channels = true
tags = {
role = "aenode"
kind = "channel"
env = "api_main"
envid = "api_main"
}
config_tags = {
bootstrap_version = var.bootstrap_version
vault_role = "ae-node"
vault_addr = var.vault_addr
bootstrap_config = "secret2/aenode/config/api_main_channel"
}
providers = {
aws = aws.eu-north-1
}
}
module "lb_main_stockholm" {
source = "github.com/aeternity/terraform-aws-api-loadbalancer?ref=v2.0.0"
env = "api_main"
fqdn = var.lb_fqdn
dns_zone = var.dns_zone
security_group = module.nodes_api_main_stockholm.sg_id
vpc_id = module.nodes_api_main_stockholm.vpc_id
subnets = module.nodes_api_main_stockholm.subnets
dry_run_enabled = true
state_channel_api_enabled = true
providers = {
aws = aws.eu-north-1
}
}
### Oregon nodes and load-balancer ###
module "nodes_api_main_oregon" {
source = "github.com/aeternity/terraform-aws-aenode-deploy?ref=v4.0.0"
env = "api_main"
static_nodes = 0
spot_nodes_min = 2
spot_nodes_max = 20
instance_type = "c5.xlarge"
instance_types = ["c5.xlarge", "c5d.xlarge", "c7i.xlarge", "c6i.xlarge"]
ami_name = "aeternity-ubuntu-22.04-v1720022468"
root_volume_size = 24
additional_storage = true
additional_storage_size = 500
asg_target_groups = module.lb_main_oregon.target_groups
tags = {
role = "aenode"
env = "api_main"
envid = "api_main"
}
config_tags = {
bootstrap_version = var.bootstrap_version
vault_role = "ae-node"
vault_addr = var.vault_addr
bootstrap_config = "secret2/aenode/config/api_main"
}
providers = {
aws = aws.us-west-2
}
}
module "lb_main_oregon" {
source = "github.com/aeternity/terraform-aws-api-loadbalancer?ref=v2.0.0"
env = "api_main"
fqdn = var.lb_fqdn
dns_zone = var.dns_zone
security_group = module.nodes_api_main_oregon.sg_id
vpc_id = module.nodes_api_main_oregon.vpc_id
subnets = module.nodes_api_main_oregon.subnets
dry_run_enabled = true
providers = {
aws = aws.us-west-2
}
}
### Singapore nodes and load-balancer ###
module "nodes_api_main_singapore" {
source = "github.com/aeternity/terraform-aws-aenode-deploy?ref=v4.0.0"
env = "api_main"
static_nodes = 0
spot_nodes_min = 2
spot_nodes_max = 20
instance_type = "c6i.xlarge"
instance_types = ["c6i.xlarge", "c5d.xlarge", "c5.xlarge"]
ami_name = "aeternity-ubuntu-22.04-v1720022468"
root_volume_size = 24
additional_storage = true
additional_storage_size = 500
asg_target_groups = module.lb_main_singapore.target_groups
tags = {
role = "aenode"
env = "api_main"
envid = "api_main"
}
config_tags = {
bootstrap_version = var.bootstrap_version
vault_role = "ae-node"
vault_addr = var.vault_addr
bootstrap_config = "secret2/aenode/config/api_main"
}
providers = {
aws = aws.ap-southeast-1
}
}
module "lb_main_singapore" {
source = "github.com/aeternity/terraform-aws-api-loadbalancer?ref=v2.0.0"
env = "api_main"
fqdn = var.lb_fqdn
dns_zone = var.dns_zone
security_group = module.nodes_api_main_singapore.sg_id
vpc_id = module.nodes_api_main_singapore.vpc_id
subnets = module.nodes_api_main_singapore.subnets
dry_run_enabled = true
providers = {
aws = aws.ap-southeast-1
}
}
## CDN ##
module "gateway_main" {
source = "github.com/aeternity/terraform-aws-api-gateway?ref=v4.0.0"
env = "api_main"
dns_zone = var.dns_zone
api_domain = var.domain
api_aliases = var.domain_aliases
certificate_arn = var.certificate_arn
lb_fqdn = var.lb_fqdn
mdw_fqdn = var.mdw_fqdn
ae_mdw_fqdn = var.ae_mdw_fqdn
ch_fqdn = module.lb_main_stockholm.dns_name
headers = var.headers
api_cache_default_ttl = 1
mdw_cache_default_ttl = 3
}