Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The custom.customDomain.stage value is being ignored #578

Closed
bwlove319 opened this issue May 12, 2023 · 0 comments · Fixed by #579
Closed

The custom.customDomain.stage value is being ignored #578

bwlove319 opened this issue May 12, 2023 · 0 comments · Fixed by #579
Labels

Comments

@bwlove319
Copy link

bwlove319 commented May 12, 2023

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
The custom.customDomain.stage value is being ignored

Command Run
sls deploy --stage blove --region us-west-2 --verbose

Console Output

Error: V1 - Make sure the 'my.domain.com' exists.
                 Unable to create base path mapping for 'my.domain.com':
Invalid stage identifier specified
    at APIGatewayV1Wrapper.<anonymous> (<path>/node_modules/serverless-domain-manager/dist/src/aws/api-gateway-v1-wrapper.js:102:23)
    at Generator.throw (<anonymous>)
    at rejected (<path>/node_modules/serverless-domain-manager/dist/src/aws/api-gateway-v1-wrapper.js:6:65)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)

Domain Manager Configuration

custom:
  customDomain:
      domainName: my.domain.com
      basePath: ""
      stage: development
      createRoute53Record: false
      autoDomain: false

Versions

  • Domain Manager version(s): 7.0.4
  • Node/npm version: v14.19.0
  • Serverless Version: 3.30.1
  • Lambda Code: Python

Possible Solution

As a workaround you can ensure that the provider.apiGateway.stage value is set to ${opt:stage} instead of a static value.

Additional context/Screenshots
serverless.yml

custom: ${file(common_config.yml):custom}

common_config.yml

custom:
  pythonRequirements:
    slim: true
    layer: true
  apiVersion: v1
  customDomain:
    domainName: my.domain.com
    basePath: ""
    stage: development
    createRoute53Record: false
    autoDomain: false

To verify I changed node_modules/serverless-domain-manager/dist/src/aws/api-gateway-v1-wrapper.js:102 to:

V1 - Make sure the '${domain.givenDomainName}' exists ${domain.apiId} ${domain.baseStage} ${domain.basePath}.

then executed:

sls deploy --stage blove --region us-west-2 --verbose

and got this output:

Error: V1 - Make sure the 'my.domain.com' exists bfowr12345 blove appname-blove.

So you can see that the stage value used is the one I specified on the sls ... command line, not the one specified in the yaml file.
The API in question is a V1 rest API proxied to a lambda function with an edge domain that already exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant