Skip to content

Quarkus JAX-RS App Deployed with AWS CDK as AWS Lambda behind HTTP API, REST API, Application Load Balancer and as Function URL


Notifications You must be signed in to change notification settings


Repository files navigation

MicroProfile with Quarkus as AWS Lambda Function deployed with Cloud Development Kit (CDK) v2 for Java

A lean starting point for building, testing and deploying Quarkus MicroProfile applications deployed as AWS Lambda behind API Gateway. The business logic, as well as, the Infrastructure as Code deployment are implemented with Java.


A Quarkus MicroProfile application:

public class GreetingResource {

    Greeter greeter;

    public String hello() {
        return this.greeter.greetings();

    public void hello(String message) {

...with an additional dependency / extension for AWS REST APIs Gateway:


or HTTP APIs Gateway (default configuration):


...deployed with AWS Cloud Development Kit:

Function createFunction(String functionName,String functionHandler, 
    Map<String,String> configuration, int memory, int maximumConcurrentExecution, int timeout) {

        return Function.Builder.create(this, functionName)

You choose between HTTP APIs gateway and REST APIs gateway with the httpAPIGatewayIntegration variable:

public class CDKApp {
    public static void main(final String[] args) {

            var app = new App();
            var appName = "quarkus-apigateway-lambda-cdk";
            Tags.of(app).add("project", "MicroProfile with Quarkus on AWS Lambda");
            Tags.of(app).add("application", appName);

            var httpAPIGatewayIntegration = true;
            new CDKStack(app, appName, true);



  1. Java / openJDK is installed
  2. Maven is installed


Same installation as aws-cdk-plain:

  1. For max convenience use the default profile. A profile named default doesn't have to be specificed with the --profile flag or configured in CDK applications.
  2. Install AWS CDK CLI
  3. cdk boostrap --profile YOUR_AWS_PROFILE

This template ships with AWS HTTP APIs Gateway. REST APIs Gateway is also supported. You can switch between both by using the corresponding extension (see Choosing between HTTP APIs and REST APIs.

Private APIs are only supported by REST API Gateway.

You can also build AWS Lambda and executable Quarkus JAR by extracting the extension into a Maven profile. Checkout:

See you at:

in action

full build

Build the Quarkus project lambda and deploy it with cdk as AWS Lambda:

cd lambda

continuous and accelerated deployment

To continuously deploy the AWS Lambda at any changes, perform:

cd cdk
cdk watch

Now on every: mvn package in lambda directory / project the JAX-RS application is re-deployed automatically.

local deployment

You can run the lambda project as regular Quarkus application with:

mvn compile quarkus:dev

The application is available under: http://localhost:8080/hello

Deploying MicroProfile / Quarkus Application as AWS Lambda with Java AWS CDK

Deploying MicroProfile / Quarkus Application as AWS Lambda with Java AWS CDK

Accelarating deployments with CDK v2 Watch

Using cdk watch for faster deployments

Accelerating Deployment with CDK v2 Watch

See you at: