Skip to content

Commit 0470481

Browse files
authored
Fix to logic to determine if ACM_CERTIFICATE_ARN should be used, or a new certificate should be created and binded. Should fix Issue #95 where CNAME cannot be binded due to certificate not being binded to CloudFront.
1 parent f7234fc commit 0470481

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

serverless.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,20 @@ resources:
6767
Aliases:
6868
Fn::If:
6969
- CustomDomain
70-
- - '${self:custom.settings.environment.CUSTOM_DOMAIN, self:custom.empty}'
70+
- - '${self:custom.settings.environment.CUSTOM_DOMAIN, ""}'
7171
- Ref: AWS::NoValue
7272
ViewerCertificate:
7373
Fn::If:
74+
- ArnCertificate
75+
- MinimumProtocolVersion: 'TLSv1'
76+
SslSupportMethod: 'sni-only'
77+
AcmCertificateArn: ${self:custom.settings.environment.ACM_CERTIFICATE_ARN,''}
78+
- Fn::If:
7479
- CreateCertificate
75-
- AcmCertificateArn: !If
76-
- ArnCertificate
77-
- self:custom.settings.environment.ACM_CERTIFICATE_ARN
78-
- Ref: Certificate
80+
- MinimumProtocolVersion: 'TLSv1'
7981
SslSupportMethod: 'sni-only'
80-
MinimumProtocolVersion: 'TLSv1'
82+
AcmCertificateArn:
83+
Ref: Certificate
8184
- Ref: AWS::NoValue
8285
Certificate:
8386
Type: AWS::CertificateManager::Certificate

0 commit comments

Comments
 (0)