/aws-lambda-graal-native-scala-example

An example of running a GraalVM native-image with Scala on AWS Lambda.

Primary LanguageScalaMIT LicenseMIT

Example: AWS Lambda + GraalVM native-image with Scala

An example of running a GraalVM native-image with Scala on AWS Lambda.

Technology stack (library)

Test this example on your AWS

Requirements

  • AWS Account
  • JDK 1.8 or later
  • Node.js 12 or later

Build

sbt dist

Set up Serverless

cp serverless/.env.example serverless/

Edit serverless/.env

AWS_PROFILE=YOUR_AWS_PROFILE_NAME

Deploy

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!"

References

Super thanks!

LICENSE

MIT