This project demonstrates deploying RESTful Spring Boot 3.2.2 application on AWS Lambda using two methods: deploying as a zip file and deploying as a docker image. It is based on the AWS sample repository.
Note for both ways of deployment, I manually uploaded the source code to
seperate lambda functions. For the zip file deployment, the application is packaged locally
using the script ./build-native-zip.sh
and for docker image deployment, GitHub Actions
workflow is used to deploy to Amazon ECR (Elastic Container Registry).
- Java 21 (runtime)
- Lombok
If you would like to build and upload to lambda from your local system, Docker needs to be installed.
To deploy a docker image, execute cd ./backend
and ./build-native-ecr.sh
in your terminal.
This script generates the docker image name server-graalvm21
tagged as native-web
.
You can view details about the image by running docker image ls
in your CLI.
To deploy a zip file, execute cd ./backend
and ./build-native-zip.sh
in your terminal.
This script produces a zip file named server-0.0.1-SNAPSHOT-native-zip.zip
in the root of
project.