← 返回首页
GitHub - Vadym79/AWSLambdaJavaWithSpringBoot: Different examples of solutions API Gateway->Lambda->DynamoDB with Lambda managed Java 21 runtime based on Spring Boot 3 with AWS Serverless Java Container, AWS Lambda Web Adapter, Spring Cloud Function (all including SnapStart enabling and various priming techniques), Custom Docker Image and GraalVM Native Image · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

Vadym79/AWSLambdaJavaWithSpringBoot

 master
Go to file
Code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
View all files

Repository files navigation

More items

Explore ways to develop, run and optimize Spring Boot application with AWS Lambda Java or Customer Runtime with GraalVM Native Image

Please follow my Spring Boot 3.4 application on AWS Lambda article series for the detailed explanation.

Architecture

Project Description

The code example include storing and retrieving product from the Amazon DynamoDB. I put Amazon API Gateway in front of my Lambdas.

I explore the following ways to run Spring Boot application with AWS Lambda Java or Customer Runtime with GraalVM Native Image:

  • Lambda with Java 21 Runtime and Spring Boot 3.2 and aws-serverless-java-container
  • Lambda with Java 21 Runtime and Spring Boot 3.2 and Spring Cloud Function
  • Lambda with Java 21 Runtime and Spring Boot 3.2 and Lambda Web Adapter
  • Lambda with Custom Runtime and Spring Boot 3.2 and GraalVM Native Image

I made all the test for the following use cases:

  • Lambda function without SnapStart enabled
  • Lambda function with SnapStart enabled but without usage of Priming
    -- doesn't currently work for AWS Custom Runtimes, so for GraalVM Native Image
  • Lambda function with SnapStart enabled but with usage of Priming (DynamoDB request invocation and if possible proxing the whole web request)
    -- doesn't currently work for AWS Custom Runtimes, so for GraalVM Native Image

Installation and deployment

Clone git repository locally git clone https://github.com/Vadym79/AWSLambdaJavaWithSpringBoot.git Compile and package the Java application with Maven from the root (where pom.xml is located) of the project mvn clean package Deploy your application with AWS SAM sam deploy -g

In order not to use AWS Lambda SnapStart comment both lines in the globals's section of the Lambda function.

Globals:
Function:
#SnapStart:
#ApplyOn: PublishedVersions

In order to user AWS Lambda SnapStart uncomment both lines above. For different Priming optimizations enabling of SnapStart is required.
SnapStart doesn't currently work for AWS Custom Runtimes, so for GraalVM Native Image.

Further Readings

My article series "Spring Boot 3 application on AWS Lambda"

My article series "AWS Lambda SnapStart"

About

Different examples of solutions API Gateway->Lambda->DynamoDB with Lambda managed Java 21 runtime based on Spring Boot 3 with AWS Serverless Java Container, AWS Lambda Web Adapter, Spring Cloud Function (all including SnapStart enabling and various priming techniques), Custom Docker Image and GraalVM Native Image

Topics

Resources

Stars

44 stars

Watchers

5 watching

Forks

Packages

 
 
 

Contributors

Languages

Footer

© 2026 GitHub, Inc.