Piers Karsenbarg

Setting Up Dns Part 2

Posted at — Apr 27, 2019

Final part of this. Set up the DNS record pointing at the CloudFront distribution.

resource "aws_route53_record" "root" {
  zone_id = "${aws_route53_zone.primary.zone_id}"

  // NOTE: name is blank here.
  name = ""
  type = "A"

  alias = {
    name = "${aws_cloudfront_distribution.www_distribution.domain_name}"
    zone_id = "${aws_cloudfront_distribution.www_distribution.hosted_zone_id}"
    evaluate_target_health = false
  }
}