amplify-education / serverless-domain-manager

Serverless plugin for managing custom domains with API Gateways.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Custom domain target is not the same as the endpoints url

adminy 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
Target Domain does not match endpoints domain. In fact Target Domain is a random combination of letters on every deployment and always just keeps changing!

Going over to the custom domain, I get:

{
    "message": "Forbidden"
}

Command Run
npx sls deploy --stage dev --region eu-west-1

Console Output

βœ” serverless-better-credentials: credentials resolved from config SharedIniFileCredentials: provider.profile (dev)

Deploying project to stage dev (eu-west-1)

βœ” Service deployed to stack project-dev (37s)

endpoints:
  GET - https://abcdefg123.execute-api.eu-west-1.amazonaws.com/health
functions:
  health: project-dev-health (16 kB)
layers:
  DepsLayer: arn:aws:lambda:eu-west-1:...:layer:DepsLayer:10
Serverless Domain Manager:
  Domain Name: subdomain.of.site.com
  Target Domain: xyzhjkr743.execute-api.eu-west-1.amazonaws.com
  Hosted Zone Id: ZCLDTFWJFENWEF

Improve API performance – monitor it with the Serverless Console: run "serverless --console"

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

custom:
  customDomain:
    apiType: http
    endpointType: regional
    securityPolicy: tls_1_2
    hostedZonePrivate: false
    domainName: subdomain.of.site.com
    basePath: ''
    certificateName: "*.of.site.com"
    certificateArn: arn:aws:acm:${aws:region}:${aws:accountId}:certificate/0c10dba2-73ba-49fb-9348-0d810574af51
    createRoute53Record: false
    createRoute53IPv6Record: false
    autoDomain: true
functions:
  health:
    module: project
    handler: scripts.health
    events:
      - httpApi:
          method: GET
          path: /health

Versions

  • Domain Manager version(s): 7.3.3
  • Node/npm version: 9.8.1
  • Serverless Version: 3.38.0
  • Lambda Code: Python

Possible Solution
Downgrading to rest does the trick

Hi @adminy

The Target Domain is the API Gateway domain name and it's not a bug

Screenshot 2024-02-08 at 15 26 37
Screenshot 2024-02-08 at 15 27 04
Screenshot 2024-02-08 at 15 37 10