serverless-domain-manager
serverless-domain-manager copied to clipboard
Serverless domain manager incorrectly inferring api gateway stage name
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
When attempting to deploy a serverless stage that has a domain, it incorrectly infers the Api gateway name as my-application-stage
whereas serverless has created the api gateway as stage-my-application
. This results in an error as Serverless Domain Manager cannot find the api gateway in the cloudformation.
Command Run
sls deploy --stage staging
Console Output
Serverless Domain Manager: Error: Error: Failed to find CloudFormation resources with an error: ValidationError: Resource ApiGatewayRestApi does not exist for stack my-application-staging
Serverless Domain Manager: Error: my-application-staging.domain.com: Error: Failed to find a stack my-application-staging
Serverless Domain Manager: Error: my-application-staging.domain.com: Error: Failed to find CloudFormation resources for my-application-staging.domain.com
Domain Manager Configuration
Replace this with your own serverless.yml
file (anonymized, of course) to help us better resolve your issue.
custom:
stage: ${opt:stage, self:provider.stage}
domains:
prod: my-application.domain.com
staging: my-application-staging.domain.com
dev: my-application-dev.domain.com
customDomain:
basePath: ""
domainName: ${self:custom.domains.${self:custom.stage}}
stage: "${self:custom.stage}"
createRoute53Record: true
certificateArn: <certificate-arn-here>
Versions
- Domain Manager version(s): 5.0.0
- Node/npm version: Node 12.7.0/npm 6.10.0
- Serverless Version: 2.3.0
- Lambda Code: Javascript
I also have the same issue when trying to deploy with
httpApi
config
Workaround is to delete stage
field from customDomain
In my case the issue was that I was using a wrong apiType. The default is rest
but my api was using http
.
So after changing it
apiType: http
it worked like charm
Hi @sam-higton
Hope you have solved this issue.
We are not supporting 5.x any more please try our latest version 6.x and let us know in case of any issues