Skip to content

Instantly share code, notes, and snippets.

@santiagopoli
Created March 19, 2018 15:18
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 santiagopoli/11b1137d1bd8011799cb88cf46e8b4f4 to your computer and use it in GitHub Desktop.
Save santiagopoli/11b1137d1bd8011799cb88cf46e8b4f4 to your computer and use it in GitHub Desktop.
Terraform Blue Green / (Optional) DNS
data "aws_route53_zone" "terraform-blue-green" {
name = "yourdomain.com."
}
resource "aws_route53_record" "terraform-blue-green" {
zone_id = "${data.aws_route53_zone.terraform-blue-green.zone_id}"
name = "v${var.infrastructure_version}.yourdomain.com"
type = "A"
alias {
name = "dualstack.${aws_elb.terraform-blue-green.dns_name}"
zone_id = "${aws_elb.terraform-blue-green.zone_id}"
evaluate_target_health = false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment