From 15f563f7abc9fe13bcc37c330a8c31174120961d Mon Sep 17 00:00:00 2001 From: David Sibley Date: Mon, 21 Aug 2023 16:13:39 +0100 Subject: [PATCH] re-wrote record to correctly use alias record type --- .../data-and-insights-wepi/redshift.tf | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/terraform/environments/data-and-insights-wepi/redshift.tf b/terraform/environments/data-and-insights-wepi/redshift.tf index 74e5ab16eef..ba245e1720e 100644 --- a/terraform/environments/data-and-insights-wepi/redshift.tf +++ b/terraform/environments/data-and-insights-wepi/redshift.tf @@ -209,8 +209,13 @@ resource "aws_lb_target_group_attachment" "redshift-data" { resource "aws_route53_record" "redshift-lb-dns" { provider = aws.core-vpc - name = format("redshift.%s", data.aws_route53_zone.inner.name) - records = [aws_lb.redshift-data.dns_name] - type = "CNAME" - zone_id = data.aws_route53_zone.inner.zone_id -} + name = format("redshift.%s", data.aws_route53_zone.inner.name) + type = "A" + zone_id = data.aws_route53_zone.inner.zone_id + + alias { + name = aws_lb.redshift-data.dns_name + zone_id = aws_lb.redshift-data.zone_id + evaluate_target_health = true + } +} \ No newline at end of file