Hello everyone,
I am deploying a lambda flask application with serverless framework with a custom domain, using this tutorial:
When deployed, the flask application is acessible at e.g.
https://<id>.execute-api.eu-west-1.amazonaws.com/dev via both HTTP/HTTPS
But the custom domain only allows HTTPS. Some inbound website automatically force HTTP so I need to fix this with a redicrect or enabling both methods.
There was no clear description of how exactly to fixes (although I found a hint in the README and on SO). Eventually I swapped to EDGE Gateway API with its own cloudfront, this was suggested by AWS support team. That worked, but now I cannot make new deployments. Instead, I get the following error:
Command Run
sls deploy
Console Output
Error: Unable to setup base domain mappings for 'domain.com': Unable to update base path mapping for 'domain.com': 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 ServerlessCustomDomain.<anonymous> (.node_modules/serverless-domain-manager/dist/src/index.js:285:27) at Generator.throw (<anonymous>) at rejected (./node_modules/serverless-domain-manager/dist/src/index.js:6:65) at runMicrotasks (<anonymous>) at processTicksAndRejections (node:internal/process/task_queues:93:5)
Possible Solution
So I’m wondering what exactly the correct solution is. I’ve noticed in the README there’s this “solution” but without the allowPathMatching: true
I get the error above.
endpointType: regional
apiType: http
allowPathMatching: true # Only for one deploy
And in the configuration below I get the following:
Error: Error: Failed to find CloudFormation resources for domain.com
at ServerlessCustomDomain.<anonymous> (/node_modules/serverless-domain-manager/dist/index.js:558:23)
at Generator.throw (<anonymous>)
at rejected (node_modules/serverless-domain-manager/dist/index.js:5:65)
So I’m almost thinking there must be some alternative way of making this happen, but if so I have not figured it out.