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