Error: CloudFront input failed validation. Could not find next.js pages for "viewerCertificate"
See original GitHub issueWhen attempting to add an ACM certificate to the CloudFront distribution, getting the error after deploying:
Error: CloudFront input failed validation. Could not find next.js pages for “viewerCertificate”
Here is the serverless.yaml:
myNextJSApp:
component: "serverless-next.js@1.14.0"
inputs:
cloudfront:
viewerCertificate:
- acmCertificateArn: "arn:aws:acm:us-east-1:xxxxxxxxxxxxx:certificate/xxxxxxx-xxxxx-xxxxx-xxxx-xxxxxxxxxxxxxx"
I do see the cloudfront distribution updating in the console, but that cert does not get added in fails with the above message.
The reason I am going down this route of trying to add the ACM cert (and CNAME), is because I want to point my A record from another AWS account to this distribution.
When I try to use go the input domain route, I get the message _Error: Domain was not found in your AWS account. Please purchase it from Route53 first then try again, since the domain is in a different AWS account. It seems like this wont work with a multi account organization for dev and prod, since it appears as the domain has to be in the same account as Cloudfront distribution.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
Actually it wouldn’t yet work on version 14 that you’re using. Try with this component “@sls-next/serverless-component@1.15.0-alpha.5”. The domain should be in the same aws org account afaik.
aws-cloudfront was already pulled into this project. We can make any changes to it in here. Also that lib is not being used to set the viewerCertificate as you would think.
@promediacorp you inputs are not correct. It’s not obvious in this case, but try: