Hleb
Hleb

Reputation: 7371

AWS Lambda function on Java with Serverless framework and GraalVM

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?

Upvotes: 1

Views: 1506

Answers (1)

Not Mandatory
Not Mandatory

Reputation: 166

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.

Upvotes: 2

Related Questions