amplify-education / serverless-domain-manager

Serverless plugin for managing custom domains with API Gateways.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: Unable to setup base domain mappings for api.MY_DOMAIN.com

coulonxyz 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
Cannot deploy serverless with custom domains for http and websocket

Command Run

AWS_REGION=eu-west-3 SLS_DEBUG=* sls create_domain --stage dev
AWS_REGION=eu-west-3 sls deploy --stage dev

Console Output

Error:
Error: Unable to setup base domain mappings for 'api.MY_DOMAIN.com':
Failed to find CloudFormation resources for 'api.MY_DOMAIN.com':
Failed to find a stack be-xxx-dev

    at ServerlessCustomDomain.<anonymous> (/Users/julien/Projects/perso/ts-be-xxx/node_modules/serverless-domain-manager/dist/src/index.js:294:27)
    at Generator.throw (<anonymous>)
    at rejected (/Users/julien.coulon/Projects/perso/ts-be-xxx/node_modules/serverless-domain-manager/dist/src/index.js:6:65)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Domain Manager Configuration
Replace this with your own serverless.yml file (anonymized, of course) to help us better resolve your issue.

custom:
  customDomain:
    http:
      domainName: ${self:custom.envConfig.apiDomainName}
      stage: ${self:provider.stage}
      basePath: 'v1'
      certificateName: ${self:custom.envConfig.certificateName}
      createRoute53Record: true
      endpointType: 'regional'
      securityPolicy: tls_1_2
    websocket:
      domainName: ${self:custom.envConfig.wsDomainName}
      stage: ${self:provider.stage}
      basePath: 'v1'
      certificateName: ${self:custom.envConfig.certificateName}
      createRoute53Record: true
      endpointType: 'regional'
      securityPolicy: tls_1_2

  envConfigs:
    dev:
      apiDomainName: api.MY_DOMAIN-dev.com
      wsDomainName: ws.MY_DOMAIN-dev.com
      certificateName: "*.MY_DOMAIN-dev.com"
    prod:
      apiDomainName: api.MY_DOMAIN.com
      wsDomainName: ws.MY_DOMAIN.com
      certificateName: "*.MY_DOMAIN.com"

  envConfig: ${self:custom.envConfigs.${self:provider.stage}}

Versions

  • Domain Manager version(s): 6.2.1
  • Node/npm version: v14.18.2 / 8.19.2
  • Serverless Version: Framework Core: 3.25.1 (local) / Plugin: 6.2.2 / SDK: 4.3.2
  • Lambda Code Javascript

Additional context/Screenshots
Add any other context about the problem here. If applicable, add screenshots to help explain.
it works fine if I only have HTTP:

custom:
  customDomain:
      domainName: ${self:custom.envConfig.apiDomainName}
      stage: ${self:provider.stage}
      basePath: 'v1'
      certificateName: ${self:custom.envConfig.certificateName}
      createRoute53Record: true
      endpointType: 'regional'
      securityPolicy: tls_1_2

I've seen other people with this issue, but it did not seem to work with only http and not with http and websocket.

Can anyone help me?

Thanks a lot.
Julien

Hi @coulonxyz

Please try the latest 6.3.3 release and let us know in case any news