From 23e3f875e5e2c57ce192254947b5d22ca25926eb Mon Sep 17 00:00:00 2001 From: umeshc-roy Date: Thu, 28 Sep 2023 10:23:56 +0100 Subject: [PATCH 1/2] Training certificate add in UAT ALB --- terraform/environments/ppud/alb_internal.tf | 6 ++ .../ppud/alb_internal_training.tf | 63 ------------------- 2 files changed, 6 insertions(+), 63 deletions(-) delete mode 100644 terraform/environments/ppud/alb_internal_training.tf diff --git a/terraform/environments/ppud/alb_internal.tf b/terraform/environments/ppud/alb_internal.tf index 680e86558ec..441d97df207 100644 --- a/terraform/environments/ppud/alb_internal.tf +++ b/terraform/environments/ppud/alb_internal.tf @@ -33,6 +33,12 @@ resource "aws_lb_listener" "PPUD-Front-End-Preprod" { } } +resource "aws_lb_listener_certificate" "PPUD-Training-Certificate" { + count = local.is-preproduction == true ? 1 : 0 + listener_arn = aws_lb_listener.PPUD-Front-End-Preprod.arn + certificate_arn = data.aws_acm_certificate.PPUD_Training_ALB[0].arn +} + resource "aws_lb_listener" "PPUD-Front-End-Prod" { count = local.is-production == true ? 1 : 0 load_balancer_arn = aws_lb.PPUD-internal-ALB[0].arn diff --git a/terraform/environments/ppud/alb_internal_training.tf b/terraform/environments/ppud/alb_internal_training.tf deleted file mode 100644 index 03771134846..00000000000 --- a/terraform/environments/ppud/alb_internal_training.tf +++ /dev/null @@ -1,63 +0,0 @@ -############################# -# PPUD Training ALB - Preprod -############################# - -resource "aws_lb" "PPUD-Training-ALB" { - count = local.is-preproduction == true ? 1 : 0 - name = "PPUD-Training-ALB" - internal = true - load_balancer_type = "application" - security_groups = [aws_security_group.PPUD-ALB.id] - subnets = [data.aws_subnet.private_subnets_b.id, data.aws_subnet.private_subnets_c.id] - - enable_deletion_protection = false - drop_invalid_header_fields = true - - tags = { - Name = "${var.networking[0].business-unit}-${local.environment}" - } -} - -resource "aws_lb_listener" "PPUD-Training-Front-End" { - count = local.is-preproduction == true ? 1 : 0 - load_balancer_arn = aws_lb.PPUD-Training-ALB[0].arn - port = "443" - protocol = "HTTPS" - ssl_policy = "ELBSecurityPolicy-2016-08" - certificate_arn = data.aws_acm_certificate.PPUD_Training_ALB[0].arn - - default_action { - type = "forward" - target_group_arn = aws_lb_target_group.PPUD-Training[0].arn - } -} - -resource "aws_lb_target_group" "PPUD-Training" { - count = local.is-preproduction == true ? 1 : 0 - name = "PPUD-Training" - port = 443 - protocol = "HTTPS" - vpc_id = data.aws_vpc.shared.id - - health_check { - enabled = true - path = "/" - interval = 30 - protocol = "HTTPS" - port = 443 - timeout = 5 - healthy_threshold = 5 - unhealthy_threshold = 2 - matcher = "302" - } - tags = { - Name = "${var.networking[0].business-unit}-${local.environment}" - } -} - -resource "aws_lb_target_group_attachment" "PPUD-PORTAL-Training" { - count = local.is-preproduction == true ? 1 : 0 - target_group_arn = aws_lb_target_group.PPUD-Training[0].arn - target_id = aws_instance.s618358rgvw023[0].id - port = 443 -} \ No newline at end of file From 5967b1b2671ee8b5ffbde3ffab121eec0c0226ea Mon Sep 17 00:00:00 2001 From: umeshc-roy Date: Thu, 28 Sep 2023 10:31:26 +0100 Subject: [PATCH 2/2] Training certificate add in UAT ALB-1 --- terraform/environments/ppud/alb_internal.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/environments/ppud/alb_internal.tf b/terraform/environments/ppud/alb_internal.tf index 441d97df207..bcec3b719da 100644 --- a/terraform/environments/ppud/alb_internal.tf +++ b/terraform/environments/ppud/alb_internal.tf @@ -35,7 +35,7 @@ resource "aws_lb_listener" "PPUD-Front-End-Preprod" { resource "aws_lb_listener_certificate" "PPUD-Training-Certificate" { count = local.is-preproduction == true ? 1 : 0 - listener_arn = aws_lb_listener.PPUD-Front-End-Preprod.arn + listener_arn = aws_lb_listener.PPUD-Front-End-Preprod[0].arn certificate_arn = data.aws_acm_certificate.PPUD_Training_ALB[0].arn }