From 5deff717a5c90df4ffafbb044340aebef655779e Mon Sep 17 00:00:00 2001 From: Andrew Pepler Date: Mon, 29 Jan 2024 15:02:09 +0000 Subject: [PATCH] re-add --- terraform/environments/cdpt-chaps/route53.tf | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/terraform/environments/cdpt-chaps/route53.tf b/terraform/environments/cdpt-chaps/route53.tf index e63a046ec91..d34737a0f59 100644 --- a/terraform/environments/cdpt-chaps/route53.tf +++ b/terraform/environments/cdpt-chaps/route53.tf @@ -42,3 +42,18 @@ resource "aws_route53_record" "external_validation_subdomain" { type = local.domain_type_sub[0] zone_id = data.aws_route53_zone.external.zone_id } + +// Route53 DNS record for directing traffic to the service +resource "aws_route53_record" "external" { + provider = aws.core-vpc + + zone_id = data.aws_route53_zone.external.zone_id + name = "${var.networking[0].application}.${var.networking[0].business-unit}-${local.environment}.modernisation-platform.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 + } +}