David Gatti
David Gatti

Reputation: 3701

Attaching Certificate to CloudDistribution with ARN fails with InvalidViewerCertificate

I'm trying to create a CloudFront Distribution using the AWS SDK under NodeJS and when I set the ARN of the cert like so

ViewerCertificate: {
    ACMCertificateArn: cert_arn,
    CertificateSource: 'acm',
    CloudFrontDefaultCertificate: false,
    MinimumProtocolVersion: 'TLSv1.1_2016',
    SSLSupportMethod: 'sni-only'
}

And then call...

cloudfront.createDistribution()

I get...

InvalidViewerCertificate: The specified SSL certificate doesn't exist, isn't in us-east-1 region, isn't valid, or doesn't include a valid certificate chain

When I create the cert I:

Only then I try to create a Distribution, which fails. Funny thing, If I

What am I missing here?

Upvotes: 0

Views: 810

Answers (1)

sudo
sudo

Reputation: 2327

The CertificateSource filed has been deprecated and instead we have to use one of the following:

ViewerCertificate$ACMCertificateArn ViewerCertificate$IAMCertificateId ViewerCertificate$CloudFrontDefaultCertificate

Upvotes: 1

Related Questions