Closed circlesmiler closed 2 years ago
Ok, I think that I now understand, that there is an additional setup on AWS needed to have a public domain for the lambdas. But now, as I have one (so... I already had one, but I didn't used it), it still have the same error... I try to dive deeper into the serverless-domain-manager
plugin, as this seems to be the problem here.
I successfully could deploy the lambdas, when I removed the serverless-domain-manager
plugin from the serverless.yml
.
Hi!
It would be good to make the custom domain setup optional for the serverless framework deployment. I'll look into that at some point. I also noticed that the profile: core
is something that is out of place generally and will remove it, thanks for noting that!
If you do want a custom domain, see here for instructions (e.g. running sls create_domain
after config is in place): https://www.serverless.com/blog/serverless-api-gateway-domain
Without a custom domain I would venture a guess that it should work if you remove the serverless-domain-manager
plugin and start from scratch e.g. first run sls remove
and then sls deploy
again.
Another option is to deploy with SAM as that deployment config doesn't contain a custom domain.
Ok... I solved it.
Things I found out:
certificateArn
property for the serverless-domain-manager
. For any reasons the certificateName
did not work.us-east-1
, it's possible to use the property endpointType: regional
, when you don't want to use CloudFrontTo be honest, at first, I was a little bit frustrated about this, but at the end, I really want a defined domain for my service, because if I want to re-deploy, I don't want to have a new domain. (This domain is part of a lot of IDE configurations etc.)
Maybe it would be nice to have a link to the blog post in the README.md
.
I also tried to blow up the serverless.yml
a little bit for my needs. Maybe you can use something of this:
custom:
stage: ${opt:stage, self:provider.stage}
domains:
prod:
url: plantuml.***.net
certArn: 'arn:aws:acm:eu-west-1:***'
dev:
url: plantuml-dev.***.net
certArn: 'arn:aws:acm:eu-west-1:***'
customDomain:
domainName: ${self:custom.domains.${self:custom.stage}.url}
certificateArn : ${self:custom.domains.${self:custom.stage}.certArn}
basePath: ''
stage: "${self:custom.stage}"
createRoute53Record: true
# 'regional' is used, because we do not use CloudFoundation
# If you want to use CloudFront, the certificate must be created in region 'us-east-1'
endpointType: regional
apigwBinary:
types:
- '*/*'
I updated the deployment instructions at some point during the summer. Closing this, but please let me know if something is still unclear. Thanks!
Hello,
I have problems with deploying the lambdas in my AWS. I did following steps:
aws cli
serverless cli
docker
~/.aws/credentials
npm install
mvn clean package
sls deploy --stage plantuml
Seems to work fine until this error appears:
I changed following parts in the
serverless.yml
(only domain/plantuml and certificateName):I do not understand, why the domain and certificate is needed here... anyway... can you help?
Reason for trying to update: The (older) version in the serverless repo (https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:293246570391:applications~plantuml-render) seems not to be working with Java 8 (Corretto). I tried to change the environment of the lambda functions manually to Java 8 (Corretto). That did not work.