Skip to content

Commit e132823

Browse files
cippaciongaknysh
andcommitted
Empty ssl_support_method when using cloudfront default certificate (#46)
The current implementation always uses "sni-only" as `ssl_support_method` in `viewer_certificate` configuration. According to Terraform documentation [0] this option is required only when using `acm_certificate_arn` or `iam_certificate_id`. In our experience this leads to a situation where Terraform tries to set `ssl_support_method` to "sni-only" at each run spending several time trying to do it (~10 minutes) without effectively setting anything (it doesn't fail though). With this commit we check the value of `acm_certificate_arn` and set the proper `ssl_support_method` only if such value is defined. [0] https://www.terraform.io/docs/providers/aws/r/cloudfront_distribution.html#ssl_support_method Co-authored-by: Andriy Knysh <[email protected]>
1 parent b7221b0 commit e132823

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ resource "aws_cloudfront_distribution" "default" {
189189

190190
viewer_certificate {
191191
acm_certificate_arn = var.acm_certificate_arn
192-
ssl_support_method = "sni-only"
192+
ssl_support_method = var.acm_certificate_arn == "" ? "" : "sni-only"
193193
minimum_protocol_version = var.minimum_protocol_version
194194
cloudfront_default_certificate = var.acm_certificate_arn == "" ? true : false
195195
}

0 commit comments

Comments
 (0)