serverless-domain-manager: Error: Unable to setup base domain mappings for
Community Note
- Please vote on this issue by adding a š reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave ā+1ā or āme tooā comments, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Bug Report
Error Description Iām trying to deploy my application to an AWS Account but Iām getting the following message:
Error: Error: Unable to setup base domain mappings for YOUR_DOMAIN_HERE
at ServerlessCustomDomain.<anonymous> (/app/artifacts/node_modules/serverless-domain-manager/dist/index.js:162:27)
at Generator.throw (<anonymous>)
at rejected (/app/artifacts/node_modules/serverless-domain-manager/dist/index.js:5:65)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
Iām using a Docker image than contains serverless@1.70.1
to execute deploy.
Command Run
sls create_domain
sls deploy
Domain Manager Configuration
Replace this with your own serverless.yml
file (anonymized, of course) to help us better resolve your issue.
custom:
customDomain:
domainName: ${opt:domainName}
stage: ${opt:stage}
createRoute53Record: false
endpointType: ${self:provider.endpointType}
Versions
- Domain Manager version(s): 4.2.0
- Node/npm version: 12.13.0
- Serverless Version: 1.70.1
- Lambda Code Nodejs
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 31
- Comments: 17
Just wanted to hop on this one after debugging. Running
SLS_DEBUG=* sls deploy --stage prod
resulted in these errors:I my stack name is
api-prod
not production. This was because in myserverless.yml
I had set thestage
for thecustomDomain
toproduction
. Changing it toprod
solved this for me.Hope this helps someone else out there encountering this issue.
When the event was http everything worked for me however setting the event to httpApi broke with the above, the fix was to specify http in my custom domain, as below;
rather than the code in the example I was following, which was
As a quick FYI and for those arriving here from a google search for the error.
Another cause of this could be under the value of
customDomain
where you can have a few different options, make sure your option matches the APIs you are building:e.g.
vs
notice āwebsocketā vs āhttpā
For anyone else stuck on this, I too enabled
SLS_DEBUG=*
and received a permission error. So this can be caused by a lack of permissions in IAM.Just adding something that was biting me, I could not define my event as
httpApi
only http+1. This was it for me!
@MadisonEhlers-Vertex I had this setting already, so that doesnāt seem to help.
Hi @olegario96
Hope you have solved this issue.
We are not supporting 4.x any more please try our latest version 6.x and let us know in case of any issues
Spent some time working it out. Upgraded to āserverless-domain-managerā: ā6.0.3ā
root cause for the issue was that āsls create_domainā was executed in different/wrong region.
I found custom domain in wrong region(Api Gateway > Custom domains in your AWS console).
Deleted custom domain from the console.
Run sls custom_domain (in correct region).
Run deploy and everything worked fine.
As I was using endpointType: āedgeā my certificate has to be in us-west-1 but mistake was to create custom domain there as well as my app will run in different region.
My customDomain setup from serverless file: customDomain: domainName: ${self:provider.stackName}.my-domain.s24cloud.net stage: ${self:custom.stage} certificateName: ā*.my-domain.s24cloud.netā certificateArn: āarn:my-cert-arnā createRoute53Record: true endpointType: āedgeā
Possible duplicate? #359
Just got this error as well trying to deploy an http api
Under Known Issues:
(8/22/2018) Creating a custom domain creates a CloudFront Distribution behind the scenes for fronting your API Gateway. This CloudFront Distribution is managed by AWS and cannot be viewed/managed by you. This is not a bug, but a quirk of how the Custom Domain feature works in API Gateway.
I donāt wanna cloudfront grrrr
Are there any update on this? Iām currently running into the same issue