Skip to content


Pulumi Java SDK lets you leverage the full power of Pulumi Infrastructure as Code Platform using the Java programming language. Java support is currently in Public Preview.

Simply write Java code in your favorite editor and Pulumi automatically provisions and manages your AWS, Azure, Google Cloud Platform, and/or Kubernetes resources, using an infrastructure-as-code approach. Use standard language features like loops, functions, classes, and IDE features like refactorig and package management that you already know and love.

For example, create three web servers:

package myinfra;

import com.pulumi.Pulumi;

import java.util.List;

public final class Infra {
    public static void main(String[] args) { -> {
            final var sg = new SecurityGroup("web-sg", SecurityGroupArgs.builder()
            for (var i = 0; i < 3; i++) {
                new Instance(String.format("web-%d", i), InstanceArgs.builder()
                                "echo \"Hello, World!\" > index.html",
                                "nohup python -m SimpleHTTPServer 80 &"))


  • Get Started with Pulumi using Java: Deploy a simple application in AWS, Azure, Google Cloud or Kubernetes using Pulumi to describe the desired infrastructure using Java.

  • Examples: Browse Java examples across many clouds and scenarios including containers, serverless, and infrastructure.

  • Docs: Learn about Pulumi concepts, follow user-guides, and consult the reference documentation. Java examples are included.

  • Community Slack: Join us in Pulumi Community Slack. All conversations and questions are welcome.

  • GitHub Discussions: Ask questions or share what you are building with Pulumi.

Getting Started

The following steps demonstrate how to declare your first cloud resources in a Pulumi Java, and deploy them to AWS, in minutes:

  1. Install Pulumi:

    To install the latest Pulumi release, run the following (see full installation instructions for additional installation options):

    $ curl -fsSL | sh
  2. Create a Project:

    After installing, you can get started with the pulumi new command:

    $ mkdir pulumi-java-demo && cd pulumi-java-demo
    $ pulumi new aws-java

    The new command offers templates, including Java templates, for all clouds. Run it without an argument and it'll prompt you with available projects.

  3. Deploy to the Cloud:

    Run pulumi up to get your code to the cloud:

    $ pulumi up

    This makes all cloud resources declared in your code. Simply make edits to your project, and subsequent pulumi ups will compute the minimal diff to deploy your changes.

  4. Use Your Program:

    Now that your code is deployed, you can interact with it. In the above example, we can find the name of the newly provisioned S3 bucket:

    $ pulumi stack output bucketName

To learn more, head over to for much more information, including tutorials, examples, and details of the core Pulumi CLI and programming model concepts.


JDK 11 or higher is required.

Apache Maven is the recommended build tool. Gradle Build Tool is also supported. Pulumi will recognize Maven and Gradle programs and automatically recompile them without any further configuration. The supported versions are:

  • Apache Maven 3.8.4
  • Gradle Build Tool 7.4

Other build tools are supported via the runtime.options.binary configuration option that can point to a pre-built jar in Pulumi.yaml:

name: myproject
  name: java
    binary: target/myproject-1.0-SNAPSHOT-jar-with-dependencies.jar


Visit for information on building Pulumi Java support from source or contributing improvements.