From 19e1a89e474f7118fcac11b89981611ab7a0b599 Mon Sep 17 00:00:00 2001 From: Fawaz Shafaat Date: Wed, 13 Mar 2024 16:38:16 +0000 Subject: [PATCH] Added route to new domain --- terraform/environments/cdpt-ifs/data.tf | 2 +- terraform/environments/cdpt-ifs/route53.tf | 34 +++++++++++----------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/terraform/environments/cdpt-ifs/data.tf b/terraform/environments/cdpt-ifs/data.tf index 2c263716500..29713ea42e2 100644 --- a/terraform/environments/cdpt-ifs/data.tf +++ b/terraform/environments/cdpt-ifs/data.tf @@ -1,6 +1,6 @@ #### This file can be used to store data specific to the member account #### data "aws_route53_zone" "application_zone" { provider = aws.core-network-services - name = "integratedfraudsystem.justice.gov.uk" + name = "integrated-fraud-system.service.justice.gov.uk" private_zone = false } diff --git a/terraform/environments/cdpt-ifs/route53.tf b/terraform/environments/cdpt-ifs/route53.tf index 074135ba8a9..6e184a2eca2 100644 --- a/terraform/environments/cdpt-ifs/route53.tf +++ b/terraform/environments/cdpt-ifs/route53.tf @@ -2,10 +2,10 @@ // ACM Public Certificate resource "aws_acm_certificate" "external" { - domain_name = local.is-production ? "integratedfraudsystem.justice.gov.uk" : "modernisation-platform.service.justice.gov.uk" + domain_name = local.is-production ? "integrated-fraud-system.service.justice.gov.uk" : "modernisation-platform.service.justice.gov.uk" validation_method = "DNS" - subject_alternative_names = local.is-production ? ["integratedfraudsystem.justice.gov.uk"] : ["${var.networking[0].application}.${var.networking[0].business-unit}-${local.environment}.modernisation-platform.service.justice.gov.uk"] + subject_alternative_names = local.is-production ? ["integrated-fraud-system.service.justice.gov.uk"] : ["${var.networking[0].application}.${var.networking[0].business-unit}-${local.environment}.modernisation-platform.service.justice.gov.uk"] tags = { Environment = local.environment } @@ -66,7 +66,7 @@ resource "aws_route53_record" "external" { resource "aws_acm_certificate" "external_prod" { count = local.is-production ? 1 : 0 - domain_name = "integratedfraudsystem.justice.gov.uk" + domain_name = "integrated-fraud-system.service.justice.gov.uk" validation_method = "DNS" lifecycle { create_before_destroy = true @@ -97,18 +97,18 @@ resource "aws_route53_record" "external_validation_prod" { } // Route53 DNS record for directing traffic to the service -// resource "aws_route53_record" "external_prod" { -// count = local.is-production ? 1 : 0 -// provider = aws.core-network-services - -// zone_id = data.aws_route53_zone.application_zone.zone_id -// name = "integratedfraudsystem.justice.gov.uk" -// type = "A" - -// alias { -// name = aws_lb.ifs_lb.dns_name -// zone_id = aws_lb.ifs_lb.zone_id -// evaluate_target_health = true -// } -// } +resource "aws_route53_record" "external_prod" { + count = local.is-production ? 1 : 0 + provider = aws.core-network-services + + zone_id = data.aws_route53_zone.application_zone.zone_id + name = "integrated-fraud-system.service.justice.gov.uk" + type = "A" + + alias { + name = aws_lb.ifs_lb.dns_name + zone_id = aws_lb.ifs_lb.zone_id + evaluate_target_health = true + } +}