What is Pulumi?
· Category: DevOps & CI/CD
Short answer
Pulumi is an Infrastructure as Code platform that lets you define infrastructure using familiar programming languages like TypeScript, Python, Go, and C#.
How it works
Instead of using a DSL like HCL, you write infrastructure code in a general-purpose language. Pulumi executes the program to determine the desired state and manages updates through its engine.
Example
import * as aws from "@pulumi/aws";
const bucket = new aws.s3.Bucket("my-bucket", {
acl: "private",
});
Why it matters
Pulumi enables code reuse, testing, and IDE support. Teams can use existing software engineering practices like unit tests and type checking for infrastructure.
Tips
- Use Pulumi stacks for environments.
- Store state in the Pulumi Service or a self-hosted backend.
- Use component resources for reuse.
Common issues
- State management requires the Pulumi Service or S3 backend.
- Language-specific bugs can be harder to debug than HCL.
- Provider coverage may lag behind Terraform.