-
-
Save nickithewatt/012d778ec24ec250ad7a4beb4e23ccc8 to your computer and use it in GitHub Desktop.
This file contains 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
# This assumes that you have already (out of band) setup AWS as your | |
# DNS provider, and created a hosted zone again the main domain, e.g | |
# against example.com. This datasource simply looks up the zone details | |
# to use in the creation of the additional sub domain records. | |
data "aws_route53_zone" "main" { | |
name = "${var.dns_domain_name}" | |
private_zone = false | |
} | |
resource "aws_route53_record" "letsencrypt-terraform" { | |
zone_id = "${data.aws_route53_zone.main.zone_id}" | |
name = "${var.dns_domain_subdomain}.${data.aws_route53_zone.main.name}" | |
type = "CNAME" | |
ttl = "60" | |
records = ["tmp-${var.dns_domain_subdomain}.${data.aws_route53_zone.main.name}"] | |
} | |
resource "aws_route53_record" "tmp-letsencrypt-terraform" { | |
zone_id = "${data.aws_route53_zone.main.zone_id}" | |
name = "tmp-${var.dns_domain_subdomain}.${data.aws_route53_zone.main.name}" | |
type = "CNAME" | |
ttl = "60" | |
records = ["${var.dns_cname_value}"] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment