3
votes

I know that there is an ability to create AWS Lambda functions on Java using Serverless framework. Basic configuration in serverless.yml usually looks something like:

service: aws-java-endpoint

frameworkVersion: ">=1.2.0 <2.0.0"

provider:
  name: aws
  runtime: java8

package:
  artifact: build/distributions/aws-java-endpoint.zip

functions:
  currentTime:
    handler: com.serverless.Handler
    events:
      - http:
          path: ping
          method: get

But with coming of GraalVM and native-image compilation for Java I look for the ability to build AWS Lambda functions written on Java using GraalVM and deploy it with Serverless.

Does Serverless framework already support native Java images feature? Or maybe there are any other alternative tools for creation Lambda functions with Java and GraalVM?

2

2 Answers

2
votes

According to this article the Serverless framework does support native GraalVM images. The given example is with Kotlin but the same technique should work for plain Java. There are a number of caveats due to using GraalVM native images.

0
votes

Micronaut utilizes Java/GraalVM/SAM.

Other related projects: