← All insightsCheat Sheet

Pulumi cheat sheet: the complete command reference

CodeWizard Engineering · 23 November 2025 · 3 min read · Beginner

This is a complete, hands-on Pulumi cheat sheet: install, configure, operate, automate and secure it - with copy-paste commands grouped by task. Bookmark it for day-to-day work, incidents and interviews alike.

Pulumi lets you define cloud infrastructure using general-purpose languages (TypeScript, Python, Go, C#), bringing loops, functions, tests and IDE support to IaC while keeping a Terraform-like plan/apply model.

Why you reach for it

  • Use real languages with loops, functions and unit tests
  • Strong typing and IDE autocomplete for cloud resources
  • Reuse existing packages and testing frameworks

Installation

bash
curl -fsSL https://get.pulumi.com | sh
pulumi version
pulumi new aws-typescript

Configuration reference

An S3 bucket defined in TypeScript.

typescript
import * as aws from "@pulumi/aws";

const assets = new aws.s3.BucketV2("assets", {
  bucket: "acme-assets",
  tags: { Environment: "prod" },
});

export const bucketName = assets.bucket;

Core commands you use daily

bash
pulumi preview
pulumi up
pulumi stack output bucketName

Stacks & deploy

bash
pulumi new aws-typescript
pulumi stack init acme/prod
pulumi preview
pulumi up --yes
pulumi destroy
pulumi stack output bucketName

Config & secrets

bash
pulumi config set aws:region eu-west-1
pulumi config set --secret dbPassword s3cr3t
pulumi stack select acme/staging

Use it in CI/CD

Preview and deploy with the Pulumi GitHub Action.

yaml
- uses: pulumi/actions@v6
  with: { command: up, stack-name: acme/prod }
  env: { PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} }

Best-practice checklist

  • Keep programs declarative; push logic into tested helpers
  • Use pulumi config set --secret for encrypted config
  • Write unit tests with the language's normal test tools

Common pitfalls to avoid

  • Putting imperative logic with side effects in resource code
  • Leaking secrets into stack config without encryption
  • No unit tests despite using a real language

Security quick wins

  • Encrypt secrets in state and config
  • Use least-privilege cloud credentials in CI

Works well with

  • Terraform - Declarative, provider-agnostic infrastructure as code with a planned, reviewable change workflow.
  • OpenTofu - The open-source, community-governed fork of Terraform - same HCL, MPL-licensed.
  • Amazon Web Services - The largest public cloud - compute, storage, networking and managed services, best driven by IaC.
A cheat sheet is muscle memory on paper - keep it close until the commands live in your fingers.

Want senior help putting Pulumi to work - or a team bootcamp on it? CodeWizard runs Israel's largest DevOps community and embeds named senior engineers with a transparent hours log. Book a free consult or explore the Academy.

Like where this is going?

Get hands-on help from the engineers who write these posts.

Book a free consult