Skip to content

Instantly share code, notes, and snippets.

@nickithewatt
Last active January 22, 2017 23:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nickithewatt/012d778ec24ec250ad7a4beb4e23ccc8 to your computer and use it in GitHub Desktop.
Save nickithewatt/012d778ec24ec250ad7a4beb4e23ccc8 to your computer and use it in GitHub Desktop.
# 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