Skip to content

Creating a native image with GraalVM for AWS Lambda execution (DDB and S3 access)

Notifications You must be signed in to change notification settings

mndeveci/aws-native-lambda-ddb-s3

Repository files navigation

Getting started

  • First, create Docker image to use native image generation (which contains graalvm-jdk and native-image)

    docker build -t mndeveci/graal-native-image-graal:latest .

  • Compile and create fat jar for lambda

    ./gradlew clean shadowJar

  • Then, run the following command to generate native app, which could be run at any linux 64bit system

    docker run -it \
     -v /Users/mndeveci/workspace/graal/aws-ddb-s3/build/libs/:/project --rm \
     mndeveci/graal-native-image-graal:latest \  
     --static -cp . -jar aws-native-lambda-ddb-s3-1.0-SNAPSHOT.jar \  
     --no-server \  
     --no-fallback \  
     --verbose \  
     --enable-all-security-services  
     -H:Name=app \  
     -H:+ReportExceptionStackTraces  \  
     -H:-AllowVMInspection \  
     -H:-UseServiceLoaderFeature \  
     -R:-InstallSegfaultHandler \  
     -H:EnableURLProtocols=http,https \  
     -H:IncludeResources="logging.properties" \  
     -H:Class=com.mndeveci.NativeExecutor \  
     -H:ReflectionConfigurationFiles=config.json \  
     -H:DynamicProxyConfigurationFiles=proxy-config.json \  
     -H:DynamicProxyConfigurationResources=proxy-config.json \  
     -H:ResourceConfigurationFiles=resource-config.json \
    

References

About

Creating a native image with GraalVM for AWS Lambda execution (DDB and S3 access)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published