Demo application to test Reactive Spring Cloud Functions on AWS Lambdas using a native runtime.
Requirements:
- Docker
- Java +17 GraalVM
- SAM
Linux:
sam build
macOS:
AWS Lambda requires native applications to be built in an Amazon Linux compatible OS, so on macOS we need to run the build in a compatible Docker container.
-
Build the Docker image compatible with AWS Linux:
./aws-image/build-aws-image.sh
-
Run
sam build
specifying the Docker image:sam build --use-container --build-image tech.aaregall.lab/amazonlinux-graalvm:latest
Define the following environment variables on the deployment host.
export AWS_REGION=...
sam deploy --region $AWS_REGION
sam logs -n SpringCloudFunctionLambda --stack-name aws-lambda-spring-cloud-function-reactive-java
sam delete SpringCloudFunctionLambda