Pulumi
Infrastructure as Code in any programming language
- Terminology
Program
: this is the template from which stacks can be createdStack
: it's an instance of the programResource
: smallest infrastructure building blockInputs/outputs
: read or set values for your resource
Project structure
my-project
├── Pulumi.dev.yaml # config overrides for the prod stack
├── Pulumi.prod.yaml # config overrides for the dev stack
├── Pulumi.yaml # base configuration
├── go.mod
├── go.sum
└── main.go
Stacks
- A stack is a
named update target
, and a single project may have many of them - It's usually used for managing environments (dev, prod, etc) with it's own overrides
- Each stack has a
configuration
andupdate history
associated with it, stored in the workspace (~/.pulumi/workspaces)
State
- The "current state" stores information about the last deployed infrastructure
- With the
current state
, pulumi knows what to create, change or delete in order to achieve thedesired state
- The state is stored at
~/.pulumi/stacks/<your-project>