Skip to content

Commit

Permalink
Workaround a bullshit issue where Terraform requires that all resourc…
Browse files Browse the repository at this point in the history
…es declared be present even if those resources have a count of 0. See here: hashicorp/terraform#16726
  • Loading branch information
Carlos Nunez committed Oct 21, 2018
1 parent e667069 commit e7bcd9e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions infrastructure/aws/dns.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ resource "aws_route53_record" "blog" {
name = "${local.route53_record_name}"
type = "CNAME"
alias {
name = "${var.enable_cloudfront_cdn == 1 ? aws_cloudfront_distribution.blog.domain_name : aws_s3_bucket.blog.website_domain}"
zone_id = "${var.enable_cloudfront_cdn == 1 ? aws_cloudfront_distribution.blog.hosted_zone_id : aws_s3_bucket.blog.hosted_zone_id}"
name = "${var.enable_cloudfront_cdn ? element(concat(aws_cloudfront_distribution.blog.*.domain_name, list("")), 0) : aws_s3_bucket.blog.website_domain}"
zone_id = "${var.enable_cloudfront_cdn ? element(concat(aws_cloudfront_distribution.blog.*.hosted_zone_id, list("")), 0) : aws_s3_bucket.blog.hosted_zone_id}"
evaluate_target_health = true
}
}

0 comments on commit e7bcd9e

Please sign in to comment.