Skip to main content

Posts

Showing posts with the label CloudFront

Troubleshooting AWS CloudFront "InvalidViewerCertificate" for Custom Domains

  Deploying a production-grade Next.js application on AWS often involves a complex interplay between S3, Lambda@Edge (or App Runner), and CloudFront. While the application logic may be flawless, infrastructure deployments frequently halt due to a specific, blocking error:   InvalidViewerCertificate . This error indicates that CloudFront cannot validate the SSL/TLS certificate associated with the custom domain you are attempting to attach. It is not a code error within your Next.js application; it is an architectural strictness within the AWS Edge network. This guide provides the root cause analysis of this failure and the infrastructure-as-code patterns required to resolve it permanently. The Root Cause: Global Edge vs. Regional Resources To fix the  InvalidViewerCertificate  error, you must understand the physical architecture of AWS CloudFront. CloudFront is a  Global  service. It does not exist within a specific region like  us-west-2  or ...