Skip to content

Commit

Permalink
If default cloudfront certificate is used, ignore minimum_protocol_ve…
Browse files Browse the repository at this point in the history
…rsion

Fixes hashicorp#407
  • Loading branch information
Eugene Dementiev committed Oct 1, 2017
1 parent fe37a32 commit 52ad2b6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions aws/cloudfront_distribution_configuration_structure.go
Original file line number Diff line number Diff line change
Expand Up @@ -1096,8 +1096,12 @@ func viewerCertificateHash(v interface{}) int {
} else {
buf.WriteString(fmt.Sprintf("%t-", m["cloudfront_default_certificate"].(bool)))
}
if v, ok := m["minimum_protocol_version"]; ok && v.(string) != "" {
buf.WriteString(fmt.Sprintf("%s-", v.(string)))
// if minimum_protocol_version is not specified and we use cloudfront_default_certificate,
// ignore current value of minimum_protocol_version
if c, ok := m["cloudfront_default_certificate"]; !(ok && c.(bool)) {
if v, ok := m["minimum_protocol_version"]; ok && v.(string) != "" {
buf.WriteString(fmt.Sprintf("%s-", v.(string)))
}
}
return hashcode.String(buf.String())
}
Expand Down

0 comments on commit 52ad2b6

Please sign in to comment.