aws/serverless-java-container

A Java wrapper to run Spring, Spring Boot, Jersey, and other apps inside AWS Lambda.

1,562

stars

1,431

commits

Java

primary language

Aug 21, 2026

updated

aws.amazon.com/serverless/
api
api-gateway
api-server
aws
aws-lambda
jersey
rest-api
serverless
sparkjava
sparkjava-framework
spring
Browse cluster: AWS Lambda serverless utilities

README

Serverless Java container Build Status Maven Central Help

The aws-serverless-java-container makes it easy to run Java applications written with frameworks such as Spring, Spring Boot, Apache Struts, Jersey, or Spark in AWS Lambda.

Serverless Java Container natively supports API Gateway's proxy integration models for requests and responses, you can create and inject custom models for methods that use custom mappings.

Currently the following versions are maintained:

VersionBranchJava Enterprise supportSpring versionsJAX-RS/ Jersey versionStruts supportSpark support
1.x1.xJava EE (javax.*)5.x (Boot 2.x)2.x:white_check_mark::white_check_mark:
2.x2.1.xJakarta EE 9-10 (jakarta.*)6.x (Boot 3.x)3.x:x::x:
3.xmainJakarta EE 11 (jakarta.*)7.x (Boot 4.x)3.x:x::x:

Follow the quick start guides in our wiki to integrate Serverless Java Container with your project:

Below is the most basic AWS Lambda handler example that launches a Spring application. You can also take a look at the samples in this repository, our main wiki page includes a step-by-step guide on how to deploy the various sample applications using Maven and SAM.

public class StreamLambdaHandler implements RequestStreamHandler {
    private static final SpringLambdaContainerHandler<AwsProxyRequest, AwsProxyResponse> handler;

    static {
        try {
            handler = SpringLambdaContainerHandler.getAwsProxyHandler(PetStoreSpringAppConfig.class);
        } catch (ContainerInitializationException e) {
            // if we fail here. We re-throw the exception to force another cold start
            e.printStackTrace();
            throw new RuntimeException("Could not initialize Spring framework", e);
        }
    }

    @Override
    public void handleRequest(InputStream inputStream, OutputStream outputStream, Context context)
            throws IOException {
        handler.proxyStream(inputStream, outputStream, context);
    }
}

Public Examples

Blogs

Workshops

Videos

Java samples with different frameworks

Contributors

(top 30 of 62)

sapessi

422 commits

deki

400 commits

dependabot[bot]

248 commits

tobixlea

68 commits

aws/serverless-java-container

A Java wrapper to run Spring, Spring Boot, Jersey, and other apps inside AWS Lambda.

1,562

stars

1,431

commits

Java

primary language

Aug 21, 2026

updated

aws.amazon.com/serverless/
api
api-gateway
api-server
aws
aws-lambda
jersey
rest-api
serverless
sparkjava
sparkjava-framework
spring
Browse cluster: AWS Lambda serverless utilities

README

Serverless Java container Build Status Maven Central Help

The aws-serverless-java-container makes it easy to run Java applications written with frameworks such as Spring, Spring Boot, Apache Struts, Jersey, or Spark in AWS Lambda.

Serverless Java Container natively supports API Gateway's proxy integration models for requests and responses, you can create and inject custom models for methods that use custom mappings.

Currently the following versions are maintained:

VersionBranchJava Enterprise supportSpring versionsJAX-RS/ Jersey versionStruts supportSpark support
1.x1.xJava EE (javax.*)5.x (Boot 2.x)2.x:white_check_mark::white_check_mark:
2.x2.1.xJakarta EE 9-10 (jakarta.*)6.x (Boot 3.x)3.x:x::x:
3.xmainJakarta EE 11 (jakarta.*)7.x (Boot 4.x)3.x:x::x:

Follow the quick start guides in our wiki to integrate Serverless Java Container with your project:

Below is the most basic AWS Lambda handler example that launches a Spring application. You can also take a look at the samples in this repository, our main wiki page includes a step-by-step guide on how to deploy the various sample applications using Maven and SAM.

public class StreamLambdaHandler implements RequestStreamHandler {
    private static final SpringLambdaContainerHandler<AwsProxyRequest, AwsProxyResponse> handler;

    static {
        try {
            handler = SpringLambdaContainerHandler.getAwsProxyHandler(PetStoreSpringAppConfig.class);
        } catch (ContainerInitializationException e) {
            // if we fail here. We re-throw the exception to force another cold start
            e.printStackTrace();
            throw new RuntimeException("Could not initialize Spring framework", e);
        }
    }

    @Override
    public void handleRequest(InputStream inputStream, OutputStream outputStream, Context context)
            throws IOException {
        handler.proxyStream(inputStream, outputStream, context);
    }
}

Public Examples

Blogs

Workshops

Videos

Java samples with different frameworks

Contributors

(top 30 of 62)

sapessi

422 commits

deki

400 commits

dependabot[bot]

248 commits

tobixlea

68 commits

Languages

Java

99.7%