forked from mit-dci/terraform-aws-opencbdc-tctl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
722 lines (577 loc) · 23.4 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
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
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
locals {
name = "hamilton"
required_tags = {
Owner = "terraform"
Environment = var.environment
}
tags = merge(var.resource_tags, local.required_tags)
# ids
vpc_id_use1 = var.create_networking ? module.vpc[0].vpc_id : var.vpc_id_use1
vpc_id_use2 = var.create_networking ? module.vpc_use2[0].vpc_id : var.vpc_id_use2
vpc_id_usw2 = var.create_networking ? module.vpc_usw2[0].vpc_id : var.vpc_id_usw2
# public subnets
public_subnets_use1 = var.create_networking ? module.vpc[0].public_subnets : var.public_subnets_use1
public_subnets_use2 = var.create_networking ? module.vpc_use2[0].public_subnets : var.public_subnets_use2
public_subnets_usw2 = var.create_networking ? module.vpc_usw2[0].public_subnets : var.public_subnets_usw2
# private subnets
private_subnets_use1 = var.create_networking ? module.vpc[0].private_subnets : var.private_subnets_use1
private_subnets_use2 = var.create_networking ? module.vpc_use2[0].private_subnets : var.private_subnets_use2
private_subnets_usw2 = var.create_networking ? module.vpc_usw2[0].private_subnets : var.private_subnets_usw2
# route tables
route_tables_use1 = var.create_networking ? concat(module.vpc[0].public_route_table_ids, module.vpc[0].private_route_table_ids) : var.route_tables_use1
route_tables_use2 = var.create_networking ? concat(module.vpc_use2[0].public_route_table_ids, module.vpc_use2[0].private_route_table_ids) : var.route_tables_use2
route_tables_usw2 = var.create_networking ? concat(module.vpc_usw2[0].public_route_table_ids, module.vpc_usw2[0].private_route_table_ids) : var.route_tables_usw2
# azs
vpc_azs_use1 = var.create_networking ? module.vpc[0].azs : var.vpc_azs_use1
vpc_azs_use2 = var.create_networking ? module.vpc_use2[0].azs : var.vpc_azs_use2
vpc_azs_usw2 = var.create_networking ? module.vpc_usw2[0].azs : var.vpc_azs_usw2
# VPC endpoints
s3_interface_endpoint_use1 = var.create_networking ? module.vpc_endpoints_use1[0].s3_interface_endpoint : var.s3_interface_endpoint_use1
s3_interface_endpoint_use2 = var.create_networking ? module.vpc_endpoints_use2[0].s3_interface_endpoint : var.s3_interface_endpoint_use2
s3_interface_endpoint_usw2 = var.create_networking ? module.vpc_endpoints_usw2[0].s3_interface_endpoint : var.s3_interface_endpoint_usw2
# Route53
hosted_zone_id = var.create_networking ? module.route53_dns[0].hosted_zone_id : var.hosted_zone_id
cert_arn = var.create_networking ? module.route53_dns[0].cert_arn : var.cert_arn
}
# get the current aws region
data "aws_region" "current" {}
# used for accesing Account ID and ARN
data "aws_caller_identity" "current" {}
################################
#### VPCs ######################
################################
# Region: us-east-1
data "aws_availability_zones" "use1" {
count = var.create_networking ? 1 : 0
state = "available"
exclude_names = [ "us-east-1a", "us-east-1b", "us-east-1f" ]
}
module "vpc" {
count = var.create_networking ? 1 : 0
source = "terraform-aws-modules/vpc/aws"
version = "2.70.0"
name = local.name
cidr = var.use1_main_network_block
azs = data.aws_availability_zones.use1[0].names
private_subnets = [
# this loop will create a one-line list as ["10.0.0.0/20", "10.0.16.0/20", "10.0.32.0/20", ...]
# with a length depending on how many Zones are available
for zone_id in data.aws_availability_zones.use1[0].zone_ids :
cidrsubnet(var.use1_main_network_block, var.subnet_prefix_extension, tonumber(substr(zone_id, length(zone_id) - 1, 1)) - 1)
]
public_subnets = [
# this loop will create a one-line list as ["10.0.128.0/20", "10.0.144.0/20", "10.0.160.0/20", ...]
# with a length depending on how many Zones are available
# there is a zone Offset variable, to make sure no collisions are present with private subnet blocks
for zone_id in data.aws_availability_zones.use1[0].zone_ids :
cidrsubnet(var.use1_main_network_block, var.subnet_prefix_extension, tonumber(substr(zone_id, length(zone_id) - 1, 1)) + var.zone_offset - 1)
]
enable_nat_gateway = true
single_nat_gateway = true
one_nat_gateway_per_az = false
enable_dns_hostnames = true
public_subnet_tags = var.public_subnet_tags
private_subnet_tags = var.private_subnet_tags
tags = local.tags
}
# Region: us-east-2
data "aws_availability_zones" "use2" {
count = var.create_networking ? 1 : 0
provider = aws.use2
state = "available"
}
module "vpc_use2" {
count = var.create_networking ? 1 : 0
source = "terraform-aws-modules/vpc/aws"
version = "2.70.0"
providers = {
aws = aws.use2
}
name = local.name
cidr = var.use2_main_network_block
azs = data.aws_availability_zones.use2[0].names
private_subnets = [
# this loop will create a one-line list as ["10.0.0.0/20", "10.0.16.0/20", "10.0.32.0/20", ...]
# with a length depending on how many Zones are available
for zone_id in data.aws_availability_zones.use2[0].zone_ids :
cidrsubnet(var.use2_main_network_block, var.subnet_prefix_extension, tonumber(substr(zone_id, length(zone_id) - 1, 1)) - 1)
]
public_subnets = [
# this loop will create a one-line list as ["10.0.128.0/20", "10.0.144.0/20", "10.0.160.0/20", ...]
# with a length depending on how many Zones are available
# there is a zone Offset variable, to make sure no collisions are present with private subnet blocks
for zone_id in data.aws_availability_zones.use2[0].zone_ids :
cidrsubnet(var.use2_main_network_block, var.subnet_prefix_extension, tonumber(substr(zone_id, length(zone_id) - 1, 1)) + var.zone_offset - 1)
]
enable_nat_gateway = true
single_nat_gateway = true
one_nat_gateway_per_az = false
enable_dns_hostnames = true
public_subnet_tags = var.public_subnet_tags
private_subnet_tags = var.private_subnet_tags
tags = local.tags
}
# Region: us-west-2
data "aws_availability_zones" "usw2" {
count = var.create_networking ? 1 : 0
provider = aws.usw2
state = "available"
exclude_names = [ "us-west-2a" ]
}
module "vpc_usw2" {
count = var.create_networking ? 1 : 0
source = "terraform-aws-modules/vpc/aws"
version = "2.70.0"
providers = {
aws = aws.usw2
}
name = local.name
cidr = var.usw2_main_network_block
azs = data.aws_availability_zones.usw2[0].names
private_subnets = [
# this loop will create a one-line list as ["10.0.0.0/20", "10.0.16.0/20", "10.0.32.0/20", ...]
# with a length depending on how many Zones are available
for zone_id in data.aws_availability_zones.usw2[0].zone_ids :
cidrsubnet(var.usw2_main_network_block, var.subnet_prefix_extension, tonumber(substr(zone_id, length(zone_id) - 1, 1)) - 1)
]
public_subnets = [
# this loop will create a one-line list as ["10.0.128.0/20", "10.0.144.0/20", "10.0.160.0/20", ...]
# with a length depending on how many Zones are available
# there is a zone Offset variable, to make sure no collisions are present with private subnet blocks
for zone_id in data.aws_availability_zones.usw2[0].zone_ids :
cidrsubnet(var.usw2_main_network_block, var.subnet_prefix_extension, tonumber(substr(zone_id, length(zone_id) - 1, 1)) + var.zone_offset - 1)
]
enable_nat_gateway = true
single_nat_gateway = true
one_nat_gateway_per_az = false
enable_dns_hostnames = true
public_subnet_tags = var.public_subnet_tags
private_subnet_tags = var.private_subnet_tags
tags = local.tags
}
################################
#### VPC Peering Connections ###
################################
# us-east-1 <-> us-east-2
module "vpc_peering_connection_use1_use2" {
count = var.create_networking ? 1 : 0
source = "./modules/vpc-peering-connection"
providers = {
aws.requester = aws.use1
aws.accepter = aws.use2
}
requester_vpc_id = local.vpc_id_use1
accepter_vpc_id = local.vpc_id_use2
requester_route_tables = local.route_tables_use1
accepter_route_tables = local.route_tables_use2
}
# us-east-2 <-> us-west-2
module "vpc_peering_connection_use1_usw2" {
count = var.create_networking ? 1 : 0
source = "./modules/vpc-peering-connection"
providers = {
aws.requester = aws.use1
aws.accepter = aws.usw2
}
requester_vpc_id = local.vpc_id_use1
accepter_vpc_id = local.vpc_id_usw2
requester_route_tables = local.route_tables_use1
accepter_route_tables = local.route_tables_usw2
}
# us-east-2 <-> us-west-2
module "vpc_peering_connection_use2_usw2" {
count = var.create_networking ? 1 : 0
source = "./modules/vpc-peering-connection"
providers = {
aws.requester = aws.use2
aws.accepter = aws.usw2
}
requester_vpc_id = local.vpc_id_use2
accepter_vpc_id = local.vpc_id_usw2
requester_route_tables = local.route_tables_use2
accepter_route_tables = local.route_tables_usw2
}
#####################
### VPC Endpoints ###
#####################
module "vpc_endpoints_use1" {
count = var.create_networking ? 1 : 0
source = "./modules/vpc-endpoints"
providers = {
aws = aws.use1
}
vpc_id = local.vpc_id_use1
public_subnets = local.public_subnets_use1
private_subnets = local.private_subnets_use1
vpc_cidr_blocks = [
var.use1_main_network_block,
var.use2_main_network_block,
var.usw2_main_network_block
]
tags = local.tags
}
module "vpc_endpoints_use2" {
count = var.create_networking ? 1 : 0
source = "./modules/vpc-endpoints"
providers = {
aws = aws.use2
}
vpc_id = local.vpc_id_use2
public_subnets = local.public_subnets_use2
private_subnets = local.private_subnets_use2
vpc_cidr_blocks = [
var.use1_main_network_block,
var.use2_main_network_block,
var.usw2_main_network_block
]
tags = local.tags
}
module "vpc_endpoints_usw2" {
count = var.create_networking ? 1 : 0
source = "./modules/vpc-endpoints"
providers = {
aws = aws.usw2
}
vpc_id = local.vpc_id_usw2
public_subnets = local.public_subnets_usw2
private_subnets =local.public_subnets_usw2
vpc_cidr_blocks = [
var.use1_main_network_block,
var.use2_main_network_block,
var.usw2_main_network_block
]
tags = local.tags
}
################################
#### ECS Clusters ##############
################################
resource "aws_iam_service_linked_role" "ecs" {
aws_service_name = "ecs.amazonaws.com"
}
# us-east-1
module "ecs" {
source = "terraform-aws-modules/ecs/aws"
version = "3.5.0"
name = var.environment
container_insights = true
capacity_providers = ["FARGATE", "FARGATE_SPOT"]
default_capacity_provider_strategy = [
{
capacity_provider = "FARGATE"
}
]
tags = local.tags
depends_on = [ aws_iam_service_linked_role.ecs ]
}
################################
## ECS EC2 ASG for us-east-1 ###
################################
module "ec2_profile" {
count = var.test_controller_launch_type == "EC2" ? 1 : 0
source = "terraform-aws-modules/ecs/aws//modules/ecs-instance-profile"
version = "3.0.0"
name = "ecs-asg"
tags = local.tags
}
# Lookup the ECS Optimized AMI for use in the ECS Cluster
data "aws_ssm_parameter" "ecs_optimized_ami" {
name = "/aws/service/ecs/optimized-ami/amazon-linux-2/recommended/image_id"
}
# ECS sec group
module "ecs_cluster_security_group" {
count = var.test_controller_launch_type == "EC2" ? 1 : 0
source = "terraform-aws-modules/security-group/aws"
version = "3.1.0"
name = "ecs-cluster-sg"
vpc_id = local.vpc_id_use1
# Allow all incoming traffic from within VPC
ingress_with_cidr_blocks = [
{
rule = "all-all"
cidr_blocks = join(",",[
var.use1_main_network_block,
var.use2_main_network_block,
var.usw2_main_network_block
])
}
]
# Allow all outgoing traffic
egress_cidr_blocks = ["0.0.0.0/0"]
egress_rules = ["all-all"]
tags = local.tags
}
# Create the autoscale group
module "ecs_cluster_asg" {
count = var.test_controller_launch_type == "EC2" ? 1 : 0
source = "terraform-aws-modules/autoscaling/aws"
version = "3.9.0"
name = "ecs-cluster-asg"
# Launch configuration
#
# launch_configuration = "my-existing-launch-configuration" # Use the existing launch configuration
# create_lc = false # disables creation of launch configuration
lc_name = "ecs-cluster-lc"
image_id = data.aws_ssm_parameter.ecs_optimized_ami.value
instance_type = var.cluster_instance_type
security_groups = [module.ecs_cluster_security_group[0].this_security_group_id]
associate_public_ip_address = false
recreate_asg_when_lc_changes = false
iam_instance_profile = module.ec2_profile[0].iam_instance_profile_id
user_data = templatefile("${path.module}/templates/user-data.sh", { cluster_name = module.ecs.ecs_cluster_id })
# Auto scaling group
vpc_zone_identifier = local.private_subnets_use1
health_check_type = "EC2"
min_size = 0
max_size = 1
desired_capacity = 1
wait_for_capacity_timeout = 0
tags = [
{
key = "Environment"
value = var.environment
propagate_at_launch = true
},
{
key = "Owner"
value = "terraform"
propagate_at_launch = true
}
]
}
################################
#### Binary Storage ############
################################
# Binaries S3 Bucket
resource "aws_s3_bucket" "binaries" {
bucket = "${data.aws_caller_identity.current.account_id}-${data.aws_region.current.name}-binaries"
force_destroy = true
tags = local.tags
}
resource "aws_s3_bucket_versioning" "binaries" {
bucket = aws_s3_bucket.binaries.id
versioning_configuration {
status = "Enabled"
}
}
resource "aws_s3_bucket_server_side_encryption_configuration" "binaries" {
bucket = aws_s3_bucket.binaries.bucket
rule {
apply_server_side_encryption_by_default {
sse_algorithm = "AES256"
}
}
}
################################
#### Test Results Storage ######
################################
# Test outputs S3 Bucket
resource "aws_s3_bucket" "agent_outputs" {
bucket = "${data.aws_caller_identity.current.account_id}-${data.aws_region.current.name}-agent-outputs"
force_destroy = true
tags = local.tags
}
resource "aws_s3_bucket_server_side_encryption_configuration" "agent_outputs" {
bucket = aws_s3_bucket.agent_outputs.bucket
rule {
apply_server_side_encryption_by_default {
sse_algorithm = "AES256"
}
}
}
################################
#### Test Controller ###########
################################
module "test_controller_service" {
source = "./modules/test-controller"
vpc_id = local.vpc_id_use1
vpc_cidr_blocks = [
var.use1_main_network_block,
var.use2_main_network_block,
var.usw2_main_network_block
]
public_subnets = local.public_subnets_use1
private_subnets = local.private_subnets_use1
hosted_zone_id = local.hosted_zone_id
azs = local.vpc_azs_use1
cluster_id = module.ecs.ecs_cluster_id
dns_base_domain = var.base_domain
binaries_s3_bucket = aws_s3_bucket.binaries.id
binaries_s3_bucket_arn = aws_s3_bucket.binaries.arn
outputs_s3_bucket = aws_s3_bucket.agent_outputs.id
create_certbot_lambda = var.create_certbot_lambda
lets_encrypt_email = var.lets_encrypt_email
s3_interface_endpoint = local.s3_interface_endpoint_use1
launch_type = var.test_controller_launch_type
cpu = var.test_controller_cpu
memory = var.test_controller_memory
health_check_grace_period_seconds = var.test_controller_health_check_grace_period_seconds
transaction_processor_repo_url = var.transaction_processor_repo_url
transaction_processor_main_branch = var.transaction_processor_main_branch
transaction_processor_github_access_token = var.transaction_processor_github_access_token
uhs_seed_generator_job_name = module.uhs_seed_generator[0].job_name
uhs_seed_generator_job_definiton_arn = module.uhs_seed_generator[0].job_definiton_arn
uhs_seed_generator_job_queue_arn = module.uhs_seed_generator[0].job_queue_arn
certbot_lambda_build_in_docker = var.lambda_build_in_docker
# Tags
tags = local.tags
}
module "uhs_seed_generator" {
source = "./modules/uhs-seed-generator"
count = var.create_uhs_seed_generator ? 1 : 0
vpc_id = local.vpc_id_use1
private_subnets = local.private_subnets_use1
max_vcpus = var.uhs_seed_generator_max_vcpus
job_vcpu = var.uhs_seed_generator_job_vcpu
job_memory = var.uhs_seed_generator_job_memory
batch_job_timeout = var.uhs_seed_generator_batch_job_timeout
binaries_s3_bucket = aws_s3_bucket.binaries.id
# Tags
tags = local.tags
}
module "opensearch" {
source = "./modules/opensearch"
count = var.create_opensearch ? 1 : 0
dns_base_domain = var.base_domain
hosted_zone_id = local.hosted_zone_id
custom_endpoint_certificate_arn = local.cert_arn
environment = var.environment
master_user_name = var.opensearch_master_user_name
master_user_password = var.opensearch_master_user_password
route53_record_ttl = var.opensearch_route53_record_ttl
opensearch_engine_version = var.opensearch_engine_version
opensearch_instance_type = var.opensearch_instance_type
opensearch_instance_count = var.opensearch_instance_count
opensearch_ebs_volume_type = var.opensearch_ebs_volume_type
opensearch_ebs_volume_size = var.opensearch_ebs_volume_size
fire_hose_buffering_interval = var.fire_hose_buffering_interval
fire_hose_index_rotation_period = var.fire_hose_index_rotation_period
# Tags
tags = local.tags
}
################################
#### Test Controller Agents ####
################################
# Region: us-east-1
resource "aws_cloudwatch_log_group" "agents_use1" {
name = "/test-controller-agents-us-east-1"
retention_in_days = 1
}
module "test_controller_agent_use1" {
source = "./modules/test-controller-agent"
providers = {
aws = aws.use1
}
vpc_id = local.vpc_id_use1
public_subnets = local.public_subnets_use1
private_subnets = local.private_subnets_use1
public_key = var.ec2_public_key
binaries_s3_bucket = aws_s3_bucket.binaries.id
outputs_s3_bucket = aws_s3_bucket.agent_outputs.id
outputs_s3_bucket_arn = aws_s3_bucket.agent_outputs.arn
s3_interface_endpoint = local.s3_interface_endpoint_use1
controller_endpoint = module.test_controller_service.agent_endpoint
controller_port = module.test_controller_service.agent_port
log_group = aws_cloudwatch_log_group.agents_use1.name
instance_types = var.agent_instance_types
# Tags
tags = local.tags
}
# Region: us-east-2
resource "aws_cloudwatch_log_group" "agents_use2" {
name = "/test-controller-agents-us-east-2"
retention_in_days = 1
}
module "test_controller_agent_use2" {
source = "./modules/test-controller-agent"
providers = {
aws = aws.use2
}
vpc_id = local.vpc_id_use2
public_subnets = local.public_subnets_use2
private_subnets = local.private_subnets_use2
public_key = var.ec2_public_key
binaries_s3_bucket = aws_s3_bucket.binaries.id
outputs_s3_bucket = aws_s3_bucket.agent_outputs.id
outputs_s3_bucket_arn = aws_s3_bucket.agent_outputs.arn
s3_interface_endpoint = local.s3_interface_endpoint_use1
controller_endpoint = module.test_controller_service.agent_endpoint
controller_port = module.test_controller_service.agent_port
log_group = aws_cloudwatch_log_group.agents_use2.name
instance_types = var.agent_instance_types
# Tags
tags = local.tags
}
# Region: us-west-2
resource "aws_cloudwatch_log_group" "agents_usw2" {
name = "/test-controller-agents-us-west-2"
retention_in_days = 1
}
module "test_controller_agent_usw2" {
source = "./modules/test-controller-agent"
providers = {
aws = aws.usw2
}
vpc_id = local.vpc_id_usw2
public_subnets = local.public_subnets_usw2
private_subnets = local.public_subnets_usw2
public_key = var.ec2_public_key
binaries_s3_bucket = aws_s3_bucket.binaries.id
outputs_s3_bucket = aws_s3_bucket.agent_outputs.id
outputs_s3_bucket_arn = aws_s3_bucket.agent_outputs.arn
s3_interface_endpoint = local.s3_interface_endpoint_use1
controller_endpoint = module.test_controller_service.agent_endpoint
controller_port = module.test_controller_service.agent_port
log_group = aws_cloudwatch_log_group.agents_usw2.name
instance_types = var.agent_instance_types
# Tags
tags = local.tags
}
################################
#### Test Controller Deploy ####
################################
module "test_controller_deploy" {
source = "./modules/test-controller-deploy"
vpc_id = local.vpc_id_use1
private_subnets = local.private_subnets_use1
binaries_s3_bucket = aws_s3_bucket.binaries.id
cluster_name = module.ecs.ecs_cluster_name
test_controller_ecr_repo = module.test_controller_service.ecr_repo
test_controller_ecs_service_name = module.test_controller_service.ecs_service_name
uhs_seed_generator_ecr_repo = module.uhs_seed_generator[0].ecr_repo
github_repo = var.test_controller_github_repo
github_repo_owner = var.test_controller_github_repo_owner
github_repo_branch = var.test_controller_github_repo_branch
github_access_token = var.test_controller_github_access_token
s3_interface_endpoint = local.s3_interface_endpoint_use1
node_container_build_image = var.test_controller_node_container_build_image
golang_container_build_image = var.test_controller_golang_container_build_image
app_container_base_image = var.test_controller_app_container_base_image
# Tags
tags = local.tags
}
################################
#### Route 53 DNS ##############
################################
module "route53_dns" {
count = var.create_networking ? 1 : 0
source = "./modules/route53_dns"
dns_base_domain = var.base_domain
# Tags
tags = local.tags
}
################################
#### Bastion Host ##############
################################
module "bastion" {
source = "./modules/bastion"
vpc_id = local.vpc_id_use1
public_subnets = local.public_subnets_use1
public_key = var.ec2_public_key
hosted_zone_id = local.hosted_zone_id
certs_efs_id = module.test_controller_service.certs_efs_id
testruns_efs_id = module.test_controller_service.testruns_efs_id
binaries_efs_id = module.test_controller_service.binaries_efs_id
dns_base_domain = var.base_domain
# Tags
environment = var.environment
}