Skip to content

Commit

Permalink
Merge pull request #163 from zalando-incubator/fix-cert-name
Browse files Browse the repository at this point in the history
Remove _ from CF resource name
  • Loading branch information
aermakov-zalando authored May 15, 2018
2 parents 3bf4254 + 15f4ae4 commit e60791e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions aws/cf_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ func generateTemplate(certs map[string]time.Time, idleConnectionTimeoutSeconds u
})

if len(certs) > 0 {
// Sort the certificate names so we have a stable order. As a nice side effect, a wildcard cert will always
// be selected as the default one if it's present.
// Sort the certificate names so we have a stable order.
certificateARNs := make([]string, 0, len(certs))
for certARN := range certs {
certificateARNs = append(certificateARNs, certARN)
Expand Down Expand Up @@ -109,7 +108,7 @@ func generateTemplate(certs map[string]time.Time, idleConnectionTimeoutSeconds u
}

// Use a new resource name every time to avoid a bug where CloudFormation fails to perform an update properly
resourceName := fmt.Sprintf("HTTPSListenerCertificate_%x", hashARNs(certificateARNs))
resourceName := fmt.Sprintf("HTTPSListenerCertificate%x", hashARNs(certificateARNs))
template.AddResource(resourceName, &cloudformation.ElasticLoadBalancingV2ListenerCertificate{
Certificates: &certificateList,
ListenerArn: cloudformation.Ref("HTTPSListener").String(),
Expand Down

0 comments on commit e60791e

Please sign in to comment.