Skip to content

Instantly share code, notes, and snippets.

@kyxap1
Created October 10, 2016 10:41
Show Gist options
  • Save kyxap1/da5f12dfe0e99f0e887d120f0132c6f2 to your computer and use it in GitHub Desktop.
Save kyxap1/da5f12dfe0e99f0e887d120f0132c6f2 to your computer and use it in GitHub Desktop.
resource "aws_route53_record" "app_cluster_reverse" {
count = "${var.app_cluster_count}"
zone_id = "${aws_route53_zone.reverse.zone_id}"
name = "${format("%s.%s.16.172.in-addr.arpa", element(split(".", element(aws_instance.app_cluster.*.private_ip, count.index)), 3), element(split(".", element(aws_instance.app_cluster.*.private_ip, count.index)), 2) )}"
type = "PTR"
ttl = "300"
records = ["${format("app-cluster-%02d.myapp.internal", count.index + 1)}"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment