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

unable to set multiple segments in base path #582

Open
ianzone opened this issue May 24, 2023 · 2 comments
Open

unable to set multiple segments in base path #582

ianzone opened this issue May 24, 2023 · 2 comments
Labels

Comments

@ianzone
Copy link

ianzone commented May 24, 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
When set multiple segments in basePath, the api is recognized as V2, even though it's a rest api (V1).

Command Run
sls deploy

Console Output

✖ Stack meeting-dev failed to deploy (135s)
Environment: linux, node 18.16.0, framework 3.31.0 (local) 3.31.0v (global), plugin 6.2.3, SDK 4.3.2
Credentials: Local, environment variables
Docs:        docs.serverless.com
Support:     forum.serverless.com
Bugs:        github.com/serverless/serverless/issues

Error:
Error: V2 - Unable to create base path mapping for 'demo-service.tin.info':
Only REGIONAL domain names can be managed through the API Gateway V2 API. For EDGE domain names, please use the API Gateway V1 API. Also note that only REST APIs can be attached to EDGE domain names.
    at APIGatewayV2Wrapper.<anonymous> (/home/ian/acte/roomzz-v1/api/meeting/node_modules/.pnpm/serverless-domain-manager@7.0.4_serverless@3.31.0/node_modules/serverless-domain-manager/dist/src/aws/api-gateway-v2-wrapper.js:118:23)
    at Generator.throw (<anonymous>)
    at rejected (/home/ian/acte/roomzz-v1/api/meeting/node_modules/.pnpm/serverless-domain-manager@7.0.4_serverless@3.31.0/node_modules/serverless-domain-manager/dist/src/aws/api-gateway-v2-wrapper.js:6:65)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

Domain Manager Configuration
using serverless.ts

    customDomain: {
      // https://github.com/amplify-education/serverless-domain-manager
      domainName: '${param:domain}',
      certificateName: '${env:Certificate_Name}',
      basePath: 'meeting/${sls:stage}',
      autoDomain: true,
      preserveExternalPathMappings: true,
    },

Versions

  • Domain Manager version(s): ^7.0.4
  • Node/pnpm version: 18.16.0/8.5.1
  • Serverless Version: 3.31.0
  • Lambda Code Javascript
@ianzone ianzone added the bug label May 24, 2023
@rddimon
Copy link
Collaborator

rddimon commented May 24, 2023

Hi @ianzone

The error says that you are using EDGE endpoint type.
Could you please switch to the REGIONAL?

@ianzone
Copy link
Author

ianzone commented May 24, 2023

but I am using the apigateway V1 and meant to use the EDGE endpoint

  functions: {
    api: {
      handler: 'dist/api.handler',
      events: [
        {
          http: {
            method: 'ANY',
            path: '/',
            cors: true, // https://www.serverless.com/framework/docs/providers/aws/events/apigateway#enabling-cors
          },
        },
        {
          http: {
            method: 'ANY',
            path: '{proxy+}',
            cors: true, // https://www.serverless.com/framework/docs/providers/aws/events/apigateway#enabling-cors
          },
        },
      ],
    },

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

No branches or pull requests

2 participants