What is Pulumi
IaC with general-purpose programming languages
Pulumi is an Infrastructure as Code (IaC) platform that allows you to describe cloud infrastructure using general-purpose programming languages: TypeScript, Python, Go, C#, Java.
Key Features
- Real Languages — TypeScript, Python, Go, C#, Java, YAML
- Multi-cloud — AWS, Azure, GCP, Kubernetes and 100+ providers
- State Management — built-in state management
- Secrets — encryption out of the box
- Policy as Code — compliance rules
Advantages over Terraform
- Full-featured languages instead of HCL
- IDE support (autocomplete, refactoring)
- Code reuse (functions, classes)
- Infrastructure testing
- Native conditionals and loops
TypeScript Example
import * as aws from "@pulumi/aws";
const bucket = new aws.s3.Bucket("my-bucket", {
website: { indexDocument: "index.html" }
});