Deploy only works for us-east-1

Just started working with the serverless framework, so very new.
I tried creating a serverless.yml file in the region: “ap-southeast-2” that:

  1. creates cloudfront
  2. creates SSL cert
  3. creates DNS entries in 53
  4. pushes all website files to S3 bucket.

it kept failing with the following:
“An error occurred while provisioning your stack: CDN - 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…”

Because the region was mentioned as the issue I tested changing the region to “us-east-1” and the deployment was successful. I changed nothing else in my yaml file. Is there any reason why the exact same deployment that is fully self contained (no dependencies on existing services except for the domain) would work in one region but not another?

1 Like

CloudFront is a “global” service (like IAM, etc), which in practice means it only exists/works in us-east-1. ACM certificates can only be used with CloudFront if they exist in us-east-1, so this is why you’re getting this error.

The easiest resolution is to just deploy your service to us-east-1. If you have to deploy your service to ap-southeast-2 then you’ll need to deploy your resources separately (since CloudFormation templates are pre-region).