Last active
April 12, 2017 02:39
-
-
Save jschr/519f78326eab578c20de6078b548b6cf to your computer and use it in GitHub Desktop.
route 53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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