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, 120 flashcards. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
A jump-to index of every table row in this cheat sheet.
An interactive map of every table and concept in this topic.
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. | ||
export const bucketName = bucket.id; | Marks a value as a stack output accessible via pulumi stack output or Stack References. | ||
runtime: name: nodejs options: typescript: true | Specifies runtime-specific options such as TypeScript compilation settings. | ||
resources: myBucket: type: aws:s3:Bucket | • Defines resources declaratively in YAML without writing code • good for simple, template-style deployments | ||
pulumi stack tag set env prod | Attaches metadata tags to a stack for grouping and filtering in Pulumi Cloud. |