-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
219 lines (169 loc) · 7.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
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
module "network" {
source = "./network"
vpc_name = "sbo_poc"
vpc_cidr_block = "10.0.0.0/16"
aws_region = var.aws_region
public_subnet_1_cidr_block = "10.0.1.0/25"
public_subnet_2_cidr_block = "10.0.1.128/25"
# Default values:
# igw_name = "igw"
# public_subnet_1_name = "public_a"
# public_subnet_2_name = "public_b"
# public_route_name = "public"
# nat_name = "nat"
# nat_eip_name = "nat_eip"
# public_subnet_1_availability_zone = "a"
# public_subnet_2_availability_zone = "b"
}
module "s3" {
source = "./s3"
nlb_logs_bucket_name = "public-nlb-access-logs-obp"
}
module "private_alb_basic" {
source = "./obp_private_alb_basic"
private_subnet_1_id = aws_subnet.private_alb_a.id
private_subnet_2_id = aws_subnet.private_alb_b.id
alb_name = "sbo-poc-alb"
vpc_id = module.network.vpc_id
vpc_cidr_block = module.network.vpc_cidr_block
lb_access_logs_bucket = module.s3.lb_access_logs_bucket
main_domain_hostname = module.primary_domain.domain_name
main_domain_hostname_cert_arn = module.openbluebrain_com_cert.certificate_arn
redirected_hostname_1 = "www.${module.alt_domain_openbrainplatform_org.domain_name}"
redirected_hostname_2 = module.alt_domain_openbrainplatform_com.domain_name
redirected_hostname_3 = "www.${module.alt_domain_openbrainplatform_com.domain_name}"
redirected_hostname_1_cert_arn = module.www_openbrainplatform_org_cert.certificate_arn
redirected_hostname_2_cert_arn = module.openbrainplatform_com_cert.certificate_arn
redirected_hostname_3_cert_arn = module.www_openbrainplatform_com_cert.certificate_arn
cert_arns = [module.openbluebrain_com_cert.certificate_arn, module.openbluebrain_ch_cert.certificate_arn, module.www_openbluebrain_com_cert.certificate_arn, module.www_openbluebrain_ch_cert.certificate_arn]
}
module "public_nlb_basic" {
source = "./obp_public_nlb_basic"
public_subnet_1_id = module.network.public_1_subnet_id
public_subnet_2_id = module.network.public_2_subnet_id
public_nlb_name = "sbo-poc-nlb"
vpc_id = module.network.vpc_id
vpc_cidr_block = module.network.vpc_cidr_block
lb_access_logs_bucket = module.s3.lb_access_logs_bucket
}
module "primary_domain" {
source = "./domain"
domain_name = "openbluebrain.com"
public_nlb_dns_name = module.public_nlb_basic.public_nlb_dns_name
public_nlb_zone_id = module.public_nlb_basic.nlb_zone_id
comment = "Primary domain"
}
module "alt_domain_openbluebrain_ch" {
source = "./domain"
domain_name = "openbluebrain.ch"
public_nlb_dns_name = module.public_nlb_basic.public_nlb_dns_name
public_nlb_zone_id = module.public_nlb_basic.nlb_zone_id
comment = "Alternative domain openbluebrain.ch"
}
module "alt_private_domain_openbluebrain_ch" {
source = "./private_domain"
domain_name = "openbluebrain.ch"
private_alb_dns_name = module.private_alb_basic.private_alb_dns_name
private_alb_zone_id = module.private_alb_basic.alb_zone_id
comment = "Alternative domain openbluebrain.ch"
vpc_id = module.network.vpc_id
}
module "alt_domain_openbrainplatform_com" {
source = "./domain"
domain_name = "openbrainplatform.com"
public_nlb_dns_name = module.public_nlb_basic.public_nlb_dns_name
public_nlb_zone_id = module.public_nlb_basic.nlb_zone_id
comment = "Alternative domain openbrainplatform.com"
}
module "alt_private_domain_openbrainplatform_com" {
source = "./private_domain"
domain_name = "openbrainplatform.com"
private_alb_dns_name = module.private_alb_basic.private_alb_dns_name
private_alb_zone_id = module.private_alb_basic.alb_zone_id
comment = "Alternative domain openbrainplatform.com"
vpc_id = module.network.vpc_id
}
module "alt_domain_shapes-registry_org" {
source = "./domain"
domain_name = "shapes-registry.org"
public_nlb_dns_name = module.public_nlb_basic.public_nlb_dns_name
public_nlb_zone_id = module.public_nlb_basic.nlb_zone_id
comment = "Alternative domain shapes-registry.org"
}
module "alt_private_domain_shapes-registry_org" {
source = "./private_domain"
domain_name = "shapes-registry.org"
private_alb_dns_name = module.private_alb_basic.private_alb_dns_name
private_alb_zone_id = module.private_alb_basic.alb_zone_id
comment = "Alternative domain shapes-registry.org"
vpc_id = module.network.vpc_id
}
module "alt_domain_openbrainplatform_org" {
source = "./domain"
domain_name = "openbrainplatform.org"
public_nlb_dns_name = module.public_nlb_basic.public_nlb_dns_name
public_nlb_zone_id = module.public_nlb_basic.nlb_zone_id
comment = "Alternative domain openbrainplatform.org"
}
module "alt_private_domain_openbrainplatform_org" {
source = "./private_domain"
domain_name = "openbrainplatform.org"
private_alb_dns_name = module.private_alb_basic.private_alb_dns_name
private_alb_zone_id = module.private_alb_basic.alb_zone_id
comment = "Alternative domain openbrainplatform.org"
vpc_id = module.network.vpc_id
}
module "openbrainplatform_org_cert" {
source = "./tls_certificate"
hostname = module.alt_domain_openbrainplatform_org.domain_name
zone_id = module.alt_domain_openbrainplatform_org.domain_zone_id
}
module "www_openbrainplatform_org_cert" {
source = "./tls_certificate"
hostname = "www.${module.alt_domain_openbrainplatform_org.domain_name}"
zone_id = module.alt_domain_openbrainplatform_org.domain_zone_id
}
module "openbrainplatform_com_cert" {
source = "./tls_certificate"
hostname = module.alt_domain_openbrainplatform_com.domain_name
zone_id = module.alt_domain_openbrainplatform_com.domain_zone_id
}
module "www_openbrainplatform_com_cert" {
source = "./tls_certificate"
hostname = "www.${module.alt_domain_openbrainplatform_com.domain_name}"
zone_id = module.alt_domain_openbrainplatform_com.domain_zone_id
}
module "openbluebrain_com_cert" {
source = "./tls_certificate"
hostname = module.primary_domain.domain_name
zone_id = module.primary_domain.domain_zone_id
}
module "www_openbluebrain_com_cert" {
source = "./tls_certificate"
hostname = "www.${module.primary_domain.domain_name}"
zone_id = module.primary_domain.domain_zone_id
}
module "openbluebrain_ch_cert" {
source = "./tls_certificate"
hostname = module.alt_domain_openbluebrain_ch.domain_name
zone_id = module.alt_domain_openbluebrain_ch.domain_zone_id
}
module "www_openbluebrain_ch_cert" {
source = "./tls_certificate"
hostname = "www.${module.alt_domain_openbluebrain_ch.domain_name}"
zone_id = module.alt_domain_openbluebrain_ch.domain_zone_id
}
module "private_alb_config" {
source = "./obp_private_alb_config"
private_alb_arn = module.private_alb_basic.private_alb_arn
aws_waf_bbp_ip_set_arn = module.private_alb_config.aws_waf_bbp_ip_set_arn
}
module "public_nlb_config" {
source = "./obp_public_nlb_config"
public_nlb_arn = module.public_nlb_basic.public_nlb_arn
private_alb_arn = module.private_alb_basic.private_alb_arn
vpc_id = module.network.vpc_id
}
module "ecr" {
source = "./ecr"
}