Custom domain target is not the same as the endpoints url
adminy opened this issue Β· comments
Adminy commented
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
Dima Revutskyi commented