From cc11a4636764ac1ce119dbb2e6ac49ddc410a50b Mon Sep 17 00:00:00 2001 From: Jon Shaw Date: Wed, 14 Feb 2018 14:22:09 +0000 Subject: [PATCH] Change Route53 Record to Alias instead of CNAME --- author-api.tf | 10 +++++++--- author.tf | 10 +++++++--- global_vars.tf | 1 - publisher.tf | 10 +++++++--- 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/author-api.tf b/author-api.tf index 473f612..df28c39 100644 --- a/author-api.tf +++ b/author-api.tf @@ -35,9 +35,13 @@ resource "aws_alb_listener_rule" "author-api" { resource "aws_route53_record" "author-api" { zone_id = "${data.aws_route53_zone.dns_zone.id}" name = "${var.env}-author-api.${var.dns_zone_name}" - type = "CNAME" - ttl = "60" - records = ["${data.aws_alb.eq.dns_name}"] + type = "A" + + alias { + name = "${data.aws_alb.eq.dns_name}" + zone_id = "${data.aws_alb.eq.zone_id}" + evaluate_target_health = false + } } data "template_file" "author-api" { diff --git a/author.tf b/author.tf index 10ce53c..0f5375a 100644 --- a/author.tf +++ b/author.tf @@ -35,9 +35,13 @@ resource "aws_alb_listener_rule" "author" { resource "aws_route53_record" "author" { zone_id = "${data.aws_route53_zone.dns_zone.id}" name = "${var.env}-author.${var.dns_zone_name}" - type = "CNAME" - ttl = "60" - records = ["${data.aws_alb.eq.dns_name}"] + type = "A" + + alias { + name = "${data.aws_alb.eq.dns_name}" + zone_id = "${data.aws_alb.eq.zone_id}" + evaluate_target_health = false + } } data "template_file" "author" { diff --git a/global_vars.tf b/global_vars.tf index 92e73fb..fe42951 100644 --- a/global_vars.tf +++ b/global_vars.tf @@ -82,4 +82,3 @@ variable "firebase_messaging_sender_id" { variable "schema_validator_url" { description = "The URL for the schema validator service" } - diff --git a/publisher.tf b/publisher.tf index 1ab4dd9..3c84d03 100644 --- a/publisher.tf +++ b/publisher.tf @@ -35,9 +35,13 @@ resource "aws_alb_listener_rule" "publisher" { resource "aws_route53_record" "publisher" { zone_id = "${data.aws_route53_zone.dns_zone.id}" name = "${var.env}-publisher.${var.dns_zone_name}" - type = "CNAME" - ttl = "60" - records = ["${data.aws_alb.eq.dns_name}"] + type = "A" + + alias { + name = "${data.aws_alb.eq.dns_name}" + zone_id = "${data.aws_alb.eq.zone_id}" + evaluate_target_health = false + } } data "template_file" "publisher" {