Skip to content

Instantly share code, notes, and snippets.

@jschr
Last active April 12, 2017 02:39
Show Gist options
  • Save jschr/519f78326eab578c20de6078b548b6cf to your computer and use it in GitHub Desktop.
Save jschr/519f78326eab578c20de6078b548b6cf to your computer and use it in GitHub Desktop.
route 53
# fetches and the existing hosted zone for the domain
data "aws_route53_zone" "domain" {
name = "${var.domain}."
}
# apex domain dns entry
resource "aws_route53_record" "apex" {
zone_id = "${data.aws_route53_zone.domain.zone_id}"
name = "${data.aws_route53_zone.domain.name}"
type = "A"
alias {
name = "${aws_cloudfront_distribution.s3_distribution.domain_name}"
zone_id = "${aws_cloudfront_distribution.s3_distribution.hosted_zone_id}"
evaluate_target_health = false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment