-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.tf.example
384 lines (353 loc) · 14.9 KB
/
main.tf.example
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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
variable "project_prefix" {
type = string
description = "prefix string put in front of string"
default = "f5xc"
}
variable "project_suffix" {
type = string
description = "prefix string put at the end of string"
default = "25"
}
variable "f5xc_api_p12_file" {
type = string
}
variable "f5xc_api_url" {
type = string
}
variable "f5xc_api_token" {
type = string
}
variable "f5xc_tenant" {
type = string
}
variable "f5xc_namespace" {
type = string
default = "system"
}
variable "f5xc_aws_cred" {
type = string
default = "ck-aws-01"
}
variable "f5xc_aws_region" {
type = string
default = "us-west-2"
}
variable "f5xc_aws_availability_zone" {
type = string
default = "a"
}
variable "owner_tag" {
type = string
default = "[email protected]"
}
variable "f5xc_aws_vpc_owner" {
type = string
default = "[email protected]"
}
variable "ssh_public_key_file" {
type = string
}
variable "create_timeout" {
type = string
default = "3600s"
}
locals {
node0_single_nic_local_subnet = format("%s-snet-node0-snic-inside-%s", var.project_prefix, var.project_suffix)
node1_single_nic_local_subnet = format("%s-snet-node1-snic-outside-%s", var.project_prefix, var.project_suffix)
node2_single_nic_local_subnet = format("%s-snet-node2-snic-workload-%s", var.project_prefix, var.project_suffix)
node0_multi_nic_inside_subnet = format("%s-snet-node0-mnic-inside-%s", var.project_prefix, var.project_suffix)
node0_multi_nic_outside_subnet = format("%s-snet-node0-mnic-outside-%s", var.project_prefix, var.project_suffix)
node0_multi_nic_workload_subnet = format("%s-snet-node0-mnic-workload-%s", var.project_prefix, var.project_suffix)
node1_multi_nic_inside_subnet = format("%s-snet-node1-mnic-inside-%s", var.project_prefix, var.project_suffix)
node1_multi_nic_outside_subnet = format("%s-snet-node1-mnic-outside-%s", var.project_prefix, var.project_suffix)
node1_multi_nic_workload_subnet = format("%s-snet-node1-mnic-workload-%s", var.project_prefix, var.project_suffix)
node2_multi_nic_inside_subnet = format("%s-snet-node2-mnic-inside-%s", var.project_prefix, var.project_suffix)
node2_multi_nic_outside_subnet = format("%s-snet-node2-mnic-outside-%s", var.project_prefix, var.project_suffix)
node2_multi_nic_workload_subnet = format("%s-snet-node2-mnic-workload-%s", var.project_prefix, var.project_suffix)
aws_availability_zone = format("%s%s", var.f5xc_aws_region, var.f5xc_aws_availability_zone)
custom_tags = {
Owner = var.owner_tag
f5xc-tenant = var.f5xc_tenant
f5xc-feature = "f5xc-aws-vpc-multinode-site"
}
}
provider "volterra" {
api_p12_file = var.f5xc_api_p12_file
url = var.f5xc_api_url
alias = "default"
timeout = "30s"
}
provider "aws" {
region = var.f5xc_aws_region
alias = "default"
}
module "vpc__multi_node_single_nic_existing_vpc_existing_subnet" {
source = "./modules/aws/vpc"
aws_owner = var.owner_tag
aws_region = var.f5xc_aws_region
aws_az_name = local.aws_availability_zone
aws_vpc_name = format("%s-vpc-mn-snic-exist-vpc-and-snet-%s", var.project_prefix, var.project_suffix)
aws_vpc_cidr_block = "172.16.44.0/22"
custom_tags = local.custom_tags
providers = {
aws = aws.default
}
}
module "vpc__multi_node_multi_nic_existing_vpc_existing_subnet" {
source = "./modules/aws/vpc"
aws_owner = var.owner_tag
aws_region = var.f5xc_aws_region
aws_az_name = local.aws_availability_zone
aws_vpc_name = format("%s-vpc-mn-mnic-exist-vpc-and-snet-%s", var.project_prefix, var.project_suffix)
aws_vpc_cidr_block = "172.16.48.0/20"
custom_tags = local.custom_tags
providers = {
aws = aws.default
}
}
module "subnet__multi_node_single_nic_existing_vpc_existing_subnet" {
source = "./modules/aws/subnet"
aws_vpc_id = module.vpc__multi_node_single_nic_existing_vpc_existing_subnet.aws_vpc["id"]
aws_vpc_subnets = [
{
name = local.node0_single_nic_local_subnet
owner = var.owner_tag
map_public_ip_on_launch = false
cidr_block = "172.16.44.0/24"
availability_zone = local.aws_availability_zone
custom_tags = local.custom_tags
},
{
name = local.node1_single_nic_local_subnet
owner = var.owner_tag
map_public_ip_on_launch = false
cidr_block = "172.16.45.0/24"
availability_zone = local.aws_availability_zone
custom_tags = local.custom_tags
},
{
name = local.node2_single_nic_local_subnet
owner = var.owner_tag
map_public_ip_on_launch = false
cidr_block = "172.16.46.0/24"
availability_zone = local.aws_availability_zone
custom_tags = local.custom_tags
}
]
providers = {
aws = aws.default
}
}
module "subnet__multi_node_multi_nic_existing_vpc_existing_subnet" {
source = "./modules/aws/subnet"
aws_vpc_id = module.vpc__multi_node_multi_nic_existing_vpc_existing_subnet.aws_vpc["id"]
aws_vpc_subnets = [
{
name = local.node0_multi_nic_inside_subnet
owner = var.owner_tag
map_public_ip_on_launch = false
cidr_block = "172.16.48.0/24"
availability_zone = local.aws_availability_zone
custom_tags = local.custom_tags
},
{
name = local.node0_multi_nic_outside_subnet
owner = var.owner_tag
map_public_ip_on_launch = false
cidr_block = "172.16.49.0/24"
availability_zone = local.aws_availability_zone
custom_tags = local.custom_tags
},
{
name = local.node0_multi_nic_workload_subnet
owner = var.owner_tag
map_public_ip_on_launch = false
cidr_block = "172.16.50.0/24"
availability_zone = local.aws_availability_zone
custom_tags = local.custom_tags
},
{
name = local.node1_multi_nic_inside_subnet
owner = var.owner_tag
map_public_ip_on_launch = false
cidr_block = "172.16.51.0/24"
availability_zone = local.aws_availability_zone
custom_tags = local.custom_tags
},
{
name = local.node1_multi_nic_outside_subnet
owner = var.owner_tag
map_public_ip_on_launch = false
cidr_block = "172.16.52.0/24"
availability_zone = local.aws_availability_zone
custom_tags = local.custom_tags
},
{
name = local.node1_multi_nic_workload_subnet
owner = var.owner_tag
map_public_ip_on_launch = false
cidr_block = "172.16.53.0/24"
availability_zone = local.aws_availability_zone
custom_tags = local.custom_tags
},
{
name = local.node2_multi_nic_inside_subnet
owner = var.owner_tag
map_public_ip_on_launch = false
cidr_block = "172.16.54.0/24"
availability_zone = local.aws_availability_zone
custom_tags = local.custom_tags
},
{
name = local.node2_multi_nic_outside_subnet
owner = var.owner_tag
map_public_ip_on_launch = false
cidr_block = "172.16.55.0/24"
availability_zone = local.aws_availability_zone
custom_tags = local.custom_tags
},
{
name = local.node2_multi_nic_workload_subnet
owner = var.owner_tag
map_public_ip_on_launch = false
cidr_block = "172.16.56.0/24"
availability_zone = local.aws_availability_zone
custom_tags = local.custom_tags
}
]
providers = {
aws = aws.default
}
}
module "f5xc_aws_vpc_multi_node_single_nic_new_vpc_new_subnet" {
source = "./modules/f5xc/site/aws/vpc"
f5xc_api_url = var.f5xc_api_url
f5xc_api_token = var.f5xc_api_token
f5xc_namespace = var.f5xc_namespace
f5xc_tenant = var.f5xc_tenant
f5xc_aws_region = var.f5xc_aws_region
f5xc_aws_cred = var.f5xc_aws_cred
f5xc_aws_vpc_owner = var.f5xc_aws_vpc_owner
f5xc_aws_vpc_site_name = format("%s-vpc-mn-snic-nvpc-nsnet-%s", var.project_prefix, var.project_suffix)
f5xc_aws_vpc_primary_ipv4 = "192.168.168.0/21"
f5xc_aws_ce_gw_type = "single_nic"
f5xc_aws_vpc_az_nodes = {
node0 = { f5xc_aws_vpc_local_subnet = "192.168.168.0/24", f5xc_aws_vpc_az_name = local.aws_availability_zone },
node1 = { f5xc_aws_vpc_local_subnet = "192.168.169.0/24", f5xc_aws_vpc_az_name = local.aws_availability_zone },
node2 = { f5xc_aws_vpc_local_subnet = "192.168.170.0/24", f5xc_aws_vpc_az_name = local.aws_availability_zone }
}
f5xc_aws_default_ce_os_version = true
f5xc_aws_default_ce_sw_version = true
f5xc_aws_vpc_no_worker_nodes = true
f5xc_aws_vpc_use_http_https_port = true
f5xc_aws_vpc_use_http_https_port_sli = true
f5xc_labels = { "aws-env" = "shared" }
ssh_public_key = file(var.ssh_public_key_file)
custom_tags = local.custom_tags
providers = {
aws = aws.default
volterra = volterra.default
}
}
output "f5xc_aws_vpc_multi_node_single_nic_new_vpc_new_subnet" {
value = module.f5xc_aws_vpc_multi_node_single_nic_new_vpc_new_subnet.f5xc_aws_vpc
}
module "f5xc_aws_vpc_multi_node_single_nic_new_vpc_new_subnet_apply_timeout_workaround" {
source = "./modules/utils/timeout"
depend_on = module.f5xc_aws_vpc_multi_node_single_nic_new_vpc_new_subnet.f5xc_aws_vpc
create_timeout = var.create_timeout
}
module "f5xc_aws_vpc_multi_node_multi_nic_new_vpc_new_subnet" {
source = "./modules/f5xc/site/aws/vpc"
f5xc_api_url = var.f5xc_api_url
f5xc_api_token = var.f5xc_api_token
f5xc_namespace = var.f5xc_namespace
f5xc_tenant = var.f5xc_tenant
f5xc_aws_region = var.f5xc_aws_region
f5xc_aws_cred = var.f5xc_aws_cred
f5xc_aws_vpc_owner = var.f5xc_aws_vpc_owner
f5xc_aws_vpc_site_name = format("%s-vpc-mn-mnic-nvpc-nsnet-%s", var.project_prefix, var.project_suffix)
f5xc_aws_vpc_primary_ipv4 = "192.168.168.0/21"
f5xc_aws_ce_gw_type = "multi_nic"
f5xc_aws_vpc_az_nodes = {
node0 = {
f5xc_aws_vpc_workload_subnet = "192.168.168.0/26", f5xc_aws_vpc_inside_subnet = "192.168.168.64/26",
f5xc_aws_vpc_outside_subnet = "192.168.168.128/26", f5xc_aws_vpc_az_name = local.aws_availability_zone
},
node1 = {
f5xc_aws_vpc_workload_subnet = "192.168.169.0/26", f5xc_aws_vpc_inside_subnet = "192.168.169.64/26",
f5xc_aws_vpc_outside_subnet = "192.168.169.128/26", f5xc_aws_vpc_az_name = local.aws_availability_zone
},
node2 = {
f5xc_aws_vpc_workload_subnet = "192.168.170.0/26", f5xc_aws_vpc_inside_subnet = "192.168.170.64/26",
f5xc_aws_vpc_outside_subnet = "192.168.170.128/26", f5xc_aws_vpc_az_name = local.aws_availability_zone
}
}
f5xc_aws_default_ce_os_version = true
f5xc_aws_default_ce_sw_version = true
f5xc_aws_vpc_no_worker_nodes = true
f5xc_aws_vpc_use_http_https_port = true
f5xc_aws_vpc_use_http_https_port_sli = true
f5xc_labels = { "aws-env" = "shared" }
ssh_public_key = file(var.ssh_public_key_file)
custom_tags = local.custom_tags
providers = {
aws = aws.default
volterra = volterra.default
}
}
output "f5xc_aws_vpc_multi_node_multi_nic_new_vpc_new_subnet" {
value = module.f5xc_aws_vpc_multi_node_multi_nic_new_vpc_new_subnet.f5xc_aws_vpc
}
module "f5xc_aws_vpc_multi_node_multi_nic_new_vpc_new_subnet_apply_timeout_workaround" {
source = "./modules/utils/timeout"
depend_on = module.f5xc_aws_vpc_multi_node_multi_nic_new_vpc_new_subnet.f5xc_aws_vpc
create_timeout = var.create_timeout
}
/*module "aws_vpc_multi_node_single_nic_existing_vpc_and_existing_subnets" {
source = "./modules/f5xc/site/aws/vpc"
depends_on = [module.subnet__multi_node_single_nic_existing_vpc_existing_subnet.aws_subnets]
f5xc_api_url = var.f5xc_api_url
f5xc_api_token = var.f5xc_api_token
f5xc_namespace = var.f5xc_namespace
f5xc_tenant = var.f5xc_tenant
f5xc_aws_region = var.f5xc_aws_region
f5xc_aws_cred = var.f5xc_aws_cred
f5xc_aws_vpc_owner = var.f5xc_aws_vpc_owner
f5xc_aws_ce_gw_type = "single_nic"
f5xc_aws_vpc_site_name = format("%s-vpc-mn-snic-exists-vpc-snet-%s", var.project_prefix, var.project_suffix)
f5xc_aws_vpc_existing_id = module.vpc__multi_node_single_nic_existing_vpc_existing_subnet.aws_vpc["id"]
f5xc_aws_vpc_az_nodes = {
node0 = {
f5xc_aws_vpc_local_existing_subnet_id = module.subnet__multi_node_single_nic_existing_vpc_existing_subnet.aws_subnets[local.node0_single_nic_local_subnet]["id"],
f5xc_aws_vpc_az_name = local.aws_availability_zone
},
node1 = {
f5xc_aws_vpc_local_existing_subnet_id = module.subnet__multi_node_single_nic_existing_vpc_existing_subnet.aws_subnets[local.node1_single_nic_local_subnet]["id"],
f5xc_aws_vpc_az_name = local.aws_availability_zone
},
node2 = {
f5xc_aws_vpc_local_existing_subnet_id = module.subnet__multi_node_single_nic_existing_vpc_existing_subnet.aws_subnets[local.node2_single_nic_local_subnet]["id"],
f5xc_aws_vpc_az_name = local.aws_availability_zone
}
}
f5xc_aws_default_ce_os_version = true
f5xc_aws_default_ce_sw_version = true
f5xc_aws_vpc_no_worker_nodes = true
f5xc_aws_vpc_use_http_https_port = true
f5xc_aws_vpc_use_http_https_port_sli = true
ssh_public_key = file(var.ssh_public_key_file)
custom_tags = local.custom_tags
providers = {
aws = aws.default
volterra = volterra.default
}
}
output "aws_vpc_multi_node_single_nic_existing_vpc_and_existing_subnets" {
value = module.aws_vpc_multi_node_single_nic_existing_vpc_and_existing_subnets.f5xc_aws_vpc
}
module "aws_vpc_multi_node_single_nic_existing_vpc_and_existing_subnets_apply_timeout_workaround" {
source = "./modules/utils/timeout"
depend_on = module.aws_vpc_multi_node_single_nic_existing_vpc_and_existing_subnets.f5xc_aws_vpc
create_timeout = var.create_timeout
}*/