What Pulumi is & the model

Real languages, resources, stacks.

Beginner12 min · lesson 1 of 12

Pulumi is infrastructure as code written in a general-purpose programming language — TypeScript, Python, Go, C#, Java, or YAML — instead of a domain-specific language like HCL. You describe the same cloud resources, but you do it with the loops, functions, classes, conditionals, and package managers of a real language. For anything that repeats or branches, that means you write ordinary code rather than learning a DSL’s special constructs for the same thing.

Under the hood Pulumi is closer to Terraform than it first appears: it uses a desired-state engine, keeps state, and drives the same cloud provider SDKs (it can even use Terraform providers). The difference is the front end. Where Terraform parses .tf files, Pulumi runs your program, and the resources you construct as objects become the desired state the engine reconciles.

Pulumi vs a DSL tool
same idea
desired state
declare, engine reconciles
state file
maps code to real resources
providers
AWS, Azure, GCP, k8s…
different
real language
TS / Python / Go / C#
real logic
loops, functions, classes
real tooling
npm/pip, tests, IDE
You get the programming ecosystem — packages, unit tests, IDE autocomplete, refactoring — applied to infrastructure.

Programs, resources, stacks

Three terms anchor everything. A project is your program plus a Pulumi.yaml. A resource is one piece of infrastructure you construct in that program (an S3 bucket, a VPC). A stack is an isolated instance of the program — dev, staging, prod — each with its own configuration and its own state. One program, many stacks, is how Pulumi handles environments.

Real language means real footguns
The power cuts both ways: because a Pulumi program is code, you can do things that make no sense in infrastructure — non-deterministic values, side effects, network calls at build time. Keep programs deterministic (no random values without a seeded resource, no reading wall-clock time into resource names) so the same program always yields the same desired state.