question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Domain is created in the wrong region

See original GitHub issue

I have a serverless app that I am deploying to us-west-2. My ACM certificate is in us-east-1 like it should be.

However, when I run sls create-domain, it successfully makes the domain in us-east-1:

Serverless: 'api.example.app' was created/updated. New domains may take up to 40 minutes to be initialized.

When I run sls deploy, it fails since it cannot find the domain in us-west-2:

 Error --------------------------------------------------
 
  Error: Could not set up basepath mapping. Try running sls create_domain first.
Error: Error: 'api.example.app' could not be found in API Gateway.
NotFoundException: Invalid domain name identifier specified
 
     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.

Files

serverless.yml

# ...
custom:
   customDomain:
     domainName: api${self:provider.variables.apiDomainName}
     basePath: ''
     stage: ${self:provider.stage}
     createRoute53Record: true
# ...

Possible Solution?

Perhaps when the API Gateway object gets created, a region can be passed to it that is set from the custom section in the yml file?

this.apigateway = new AWS.APIGateway({ region: customRegion || 'us-east-1' });

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
JohanShoguncommented, Aug 14, 2018

I had the exact same issue as ascheucher, one solution is to use the certificateArn property instead of the certificateName property, then the certificate can be in any region while you still do the api gateway calls in the correct region.

5reactions
sohailalam2commented, Jan 31, 2018

So I also had the same issue. After spending a lot of time digging around I got it to work. Here is the answer/solution.

  1. Certificates for CloudFront can only be in the us-east-1 region. Refer This

  2. Add region to provider as

provider:
  name: aws
  runtime: nodejs6.10
  stage: dev
  region: ap-southeast-1
  1. Create the domain using the normal command
sls create_domain
Read more comments on GitHub >

github_iconTop Results From Across the Web

International domains
International domains help search engines display the correct region-specific domain when your store appears in search results. For example, search results for ...
Read more >
Solved: Default environment created in wrong region
My default environment is located in the US but the admin account is connected to a Canadian domain. I understand that I cannot...
Read more >
Wrong region - Google Search Community
Wrong region · Open the Google country domain you want to use for searching (e.g., https://www.google.de) · Open Settings > Search settings ·...
Read more >
How to change region? - Render
Start a new Web Service and database with new region. Do not change A Record. Add old domain address to new Web Service....
Read more >
Deploy domain controllers in additional regions
This page also shows you how to add or remove a region from your domain. Managed Microsoft AD supports multiple regions. Combined with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found