Pulumi

Pulumi

Infrastructure as Code using real programming languages

Features

  • Define infrastructure in TypeScript, Python, Go, or C#
  • Multi-cloud support with unified API
  • Real programming constructs (loops, functions, classes)
  • Built-in testing framework for infrastructure code

Pros

  • Use familiar programming languages instead of DSL
  • Full IDE support with autocompletion and type checking
  • Can test infrastructure code with standard test frameworks

Cons

  • Smaller community and fewer examples than Terraform
  • State management still requires cloud backend or self-hosting
  • Learning curve if coming from declarative IaC tools

Overview

Pulumi is an infrastructure as code platform that lets you define and manage cloud infrastructure using general-purpose programming languages like TypeScript, Python, Go, and C#. Unlike Terraform’s HCL, Pulumi leverages the full power of real programming languages, including loops, conditionals, functions, classes, and package managers.

Using real languages means you get full IDE support with autocompletion, type checking, inline documentation, and refactoring tools. You can also test your infrastructure code using standard testing frameworks like Jest, pytest, or Go’s testing package, bringing software engineering best practices to infrastructure management.

Pulumi supports all major cloud providers and can provision the same resources as Terraform, using provider packages that mirror the cloud provider APIs.

When to Use

Choose Pulumi when your team prefers defining infrastructure in TypeScript, Python, or another general-purpose language over learning HCL. It is ideal for developers who want to apply software engineering practices (testing, abstraction, composition) to infrastructure code.

Getting Started

curl -fsSL https://get.pulumi.com | sh
pulumi new aws-typescript
pulumi up
import * as aws from "@pulumi/aws"

const bucket = new aws.s3.Bucket("my-bucket", {
  website: { indexDocument: "index.html" }
})