amplify-education / serverless-domain-manager

Serverless plugin for managing custom domains with API Gateways.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The `custom.customDomain.stage` value is being ignored

bwlove319 opened this issue Β· comments

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.