IAC / A CONCEPT NOTE

Pulumi

infrastructure as code using real programming languages

~80 sec read

Overview · mechanism
pitfall · examples

01 / THE SHORT VERSION

The idea in a few sentences.

Pulumi lets you define cloud infrastructure in TypeScript, Python, Go, or C# — not a DSL like HCL. You write a for loop to create 10 S3 buckets? Done. Import a library for string manipulation? Easy. Pulumi translates your code into cloud API calls and stores state just like Terraform.

02 / FOLLOW THE MECHANISM

How pulumi differs from terraform

  1. You

    write new aws.s3.Bucket('my-bucket') in TypeScript, with full IDE autocompletion.

  2. Pulumi CLI

    runs your code — constructs a dependency graph from your program execution.

  3. State engine

    compares the desired state (from your code) against the current state (from the backend).

  4. Provider

    calls AWS APIs to create, update, or delete resources — or previews the changes with pulumi preview.

04 / COMMAND NOTES

Read the command, then the result.

Inspect the flags and arguments before trying an example. Snippets can need local setup, replacement values, or resources in your own environment.

EXAMPLE 01 · REFERENCE

scaffold a new Pulumi project

pulumi new aws-typescript

EXAMPLE 02 · REFERENCE

select a stack and deploy

pulumi stack select dev && pulumi up

Explore command anatomy in the CLI lab