Pulumi is an open-source infrastructure-as-code platform that lets you define, deploy, and manage cloud resources using general-purpose programming languages — TypeScript, Python, Go, C#, Java, and YAML. Unlike HCL-based tools, Pulumi programs are real code with loops, conditionals, classes, and package ecosystems. The core model maps Programs → Projects (defined by Pulumi.yaml) → Stacks (isolated deployment instances per environment) → Resources (cloud primitives created via provider SDKs). This cheat sheet covers the full surface: CLI workflows, configuration and secrets, inputs/outputs, resource options, component resources, Automation API, ESC, testing, CI/CD, and comparisons with Terraform.
What This Cheat Sheet Covers
This topic spans 20 focused tables and 146 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
Table 1: Core Concepts and Program Structure
Programs are written in any supported language and declare cloud resources using provider SDKs. A project is a folder containing a Pulumi.yaml file; a stack is one isolated deployment of that project (e.g., dev, staging, prod). Understanding the relationship between programs, projects, and stacks is the foundation of all Pulumi work.
| Command | Example | Description |
|---|---|---|
name: my-appruntime: nodejsdescription: My Pulumi app | • Root file that defines the project name, runtime, and description • required in every Pulumi project directory | |
pulumi stack init devpulumi stack select prod | • An isolated deployment instance of a project • each stack has its own config, state, and outputs | |
const bucket = new aws.s3.Bucket("my-bucket"); | • Declares a cloud resource • Pulumi registers it with the provider and tracks it in state | |
bucket = aws.s3.Bucket("my-bucket") | • Same resource declaration pattern in Python • positional arg is the logical name. |