Spring Framework On Lambda (Without Spring Boot)
Spring framework and Spring Boot are different things.
Even the repositories are distinct.
We won’t cover what is what in this article but simply you can read descriptions of these repositories.
If you need Spring Boot on Lambda AWS already has a great starter project making use of the Maven archetypes.
I am not going to bother you with blah blah blah just check out the starter I created! I also wrote some comments for your better understanding.
- You will need sam-cli. What is sam-cli?
- You will need aws-cli and configure your IAM ACCESS and SECRET
aws configure set aws_access_key_id *o*o*o*o*o*o*o*o*o
aws configure set aws_secret_access_key *o*o*o*o*o*o*o*o*o
aws configure set default.region us-east-1
- How to build and deploy
MAVEN_OPTS="-DskipTests=true" sam build
sam deploy --stack-name ${STACK_NAME} --s3-bucket ${DEPLOY_BUCKET} --capabilities CAPABILITY_IAM
or use shell scripts under the repository but don't forget to change your deploy bucket (an empty bucket to use for the deploy process)
sh sam-build.sh
sh sam-deploy.sh
And our Lambda Function just hatched 🐣
Thanks for reading.
Please follow me if you like and don’t hesitate to ask questions in the comments!