AWS Lambda Runtime

Runtime for AWS Lambdas with GraalVM compatibility and DI.

License

License

MIT License
Categories

Categories

AWS Container PaaS Providers AWS Lambda
GroupId

GroupId

com.github.goodforgod
ArtifactId

ArtifactId

aws-lambda-runtime
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

pom.sha512
Description

Description

AWS Lambda Runtime
Runtime for AWS Lambdas with GraalVM compatibility and DI.

Download aws-lambda-runtime

Dependencies

compile (2)

Group / Artifact Type Version
io.micronaut : micronaut-inject-java jar
com.fasterxml.jackson.core : jackson-annotations jar 2.11.3

runtime (1)

Group / Artifact Type Version
com.fasterxml.jackson.core : jackson-databind jar 2.11.3

Project Modules

There are no modules declared in this project.

AWS Lambda Runtime

AWS lambda runtime with Micronaut DI support with GraalVM native lambda compatability.

Provides Java native library AwsLambdaRuntime with support for Dependency Injection from Micronaut framework.

Dependencies

Do not forget to add such dependencies in you build for DI and GraalVM support:

dependencies {
    annotationProcessor 'io.micronaut:micronaut-inject-java'
    annotationProcessor 'io.micronaut:micronaut-graal'

    compileOnly 'org.graalvm.nativeimage:svm'
}

How To

You just need to implement Lambda interface and implement it.

@Singleton
public class MyLambda implements Lambda<String, String> {

    public String handle(String s) {
        return "response for " + s;
    }
}

All will be setup for using it as AWS lambda, you will need just to correctly provide GraalVM properties for image to be build.

Logging

You can use provided LambdaLogger for logging.

@Singleton
public class MyLambda implements Lambda<String, String> {

    private final LambdaLogger logger;
    
    @Inject
    public MyLambda(LambdaLogger logger) {
        this.logger = logger;
    }

    public String handle(String s) {
        return "response for " + s;
    }
}

Versions

Version
1.0.0