From 90bf7f6447df515a810da0d54cb787a591308257 Mon Sep 17 00:00:00 2001 From: Fawaz Shafaat Date: Thu, 8 Feb 2024 11:42:35 +0000 Subject: [PATCH] Made changes again --- .../environments/cdpt-chaps/loadbalancer.tf | 13 ------------- terraform/environments/cdpt-chaps/route53.tf | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/terraform/environments/cdpt-chaps/loadbalancer.tf b/terraform/environments/cdpt-chaps/loadbalancer.tf index 3a6906274cc..674e5edd34a 100644 --- a/terraform/environments/cdpt-chaps/loadbalancer.tf +++ b/terraform/environments/cdpt-chaps/loadbalancer.tf @@ -63,16 +63,3 @@ resource "aws_lb_listener" "https_listener" { } } -# This will build on the core-vpc development account under platforms-development.modernisation-platform.service.justice.gov.uk, and route traffic back to example LB -resource "aws_route53_record" "external_prod" { - provider = aws.core-vpc - zone_id = data.aws_route53_zone.external.zone_id - name = "${local.environment}.correspondence-handling-and-processing.service.justice.gov.uk" - type = "A" - - alias { - name = aws_lb.chaps_lb.dns_name - zone_id = aws_lb.chaps_lb.zone_id - evaluate_target_health = true - } -} diff --git a/terraform/environments/cdpt-chaps/route53.tf b/terraform/environments/cdpt-chaps/route53.tf index 64d98733551..bb4e19afa01 100644 --- a/terraform/environments/cdpt-chaps/route53.tf +++ b/terraform/environments/cdpt-chaps/route53.tf @@ -20,6 +20,7 @@ resource "aws_acm_certificate_validation" "external" { validation_record_fqdns = [local.domain_name_main[0], local.domain_name_sub[0]] } + // Route53 DNS records for certificate validation resource "aws_route53_record" "external_validation" { provider = aws.core-network-services @@ -95,6 +96,21 @@ resource "aws_route53_record" "external_validation_prod" { ttl = 60 } +# This will build on the core-vpc development account under platforms-development.modernisation-platform.service.justice.gov.uk, and route traffic back to example LB +resource "aws_route53_record" "external_prod" { + provider = aws.core-vpc + zone_id = data.aws_route53_zone.external_prod.zone_id + name = "${local.environment}.correspondence-handling-and-processing.service.justice.gov.uk" + type = "A" + + alias { + name = aws_lb.chaps_lb.dns_name + zone_id = aws_lb.chaps_lb.zone_id + evaluate_target_health = true + } +} + + // Route53 DNS record for directing traffic to the service //resource "aws_route53_record" "external_prod" { // count = local.is-production ? 1 : 0