DEV Community

Discussion on: Deploy your static React app to AWS Cloudfront using CDK

Collapse
 
connor_hawley profile image
Connor Hawley • Edited

A note on the site distribution - the aliasConfiguration has been deprecated. Instead, use viewerCertificate. it will look something like this:

viewerCertificate: cloudfront.ViewerCertificate.fromAcmCertificate(siteCertificate, {
        aliases: [WEB_APP_DOMAIN],
        securityPolicy: cloudfront.SecurityPolicyProtocol.TLS_V1_2_2021,
        sslMethod: cloudfront.SSLMethod.SNI
}),
Enter fullscreen mode Exit fullscreen mode

to do this you also need to make the return value of the siteCertificate not siteCertificateArn but the certificate object itself