An example of running a GraalVM native-image with Scala on AWS Lambda.
- sbt-native-image: Generate native-image binaries
- ZIO: Type-safe, composable library for async, concurrent programming
- sttp: Http client
- circe: JSON library
- Logback: Logging
- Serverless Framework: Deployment
- AWS Account
- JDK
1.8
orlater
- Node.js
12
orlater
sbt dist
cp serverless/.env.example serverless/
Edit serverless/.env
AWS_PROFILE=YOUR_AWS_PROFILE_NAME
sbt deploy
If the deploy is successful, the following message will be displayed.
GET - https://xxx.execute-api.ap-northeast-1.amazonaws.com/dev/
functions:
aws-lambda-graal-native-scala-example: aws-lambda-graal-native-scala-example
layers:
None
Serverless: Removing old service artifacts from S3...
Now, you can access https://xxx.execute-api.ap-northeast-1.amazonaws.com/dev/
and if you see the following message, you have succeeded.
"Hello, GraalVM native-image with Scala!"
Super thanks!
MIT