Skip to content

Commit

Permalink
Added conditional (#9)
Browse files Browse the repository at this point in the history
* Output variable was referencing incorrect value

* Removed option that sets cloudfront_default_certificate
- According to terraform documentation you either have to set cloudfront_default_certificate or acm_certificate_arn for viewer_certificate in the aws_cloudfront_distribution resource, but not both.

* Added a conditional to viewer_certificate block
- This was needed because if you set acm_certificate_arn then cloudfront_default_certificate needs to be false otherwise it needs to be true.
  • Loading branch information
cliveza authored and aknysh committed Feb 15, 2018
1 parent 58181b9 commit 07fae50
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ resource "aws_cloudfront_distribution" "default" {
acm_certificate_arn = "${var.acm_certificate_arn}"
ssl_support_method = "sni-only"
minimum_protocol_version = "TLSv1"
cloudfront_default_certificate = true
cloudfront_default_certificate = "${var.acm_certificate_arn == "" ? 1 : 0}"
}

default_cache_behavior {
Expand Down

0 comments on commit 07fae50

Please sign in to comment.