What is the Pulumi vs Terraform choice?
Both define infrastructure as code, but differently. Terraform uses its own declarative language, HCL. Pulumi lets you write infrastructure in a general programming language like TypeScript or Python, with loops, functions, and your normal tooling. The trade-off is real and worth understanding.
Why it matters
The IaC tool shapes how your whole team works with infrastructure for years. Knowing the strengths of each — Terraform's huge ecosystem and simplicity, Pulumi's programming power — lets you make a deliberate choice rather than following a trend. Interviews often probe whether you can compare tools with reasons.
What to learn
- HCL's declarative model versus general-purpose code
- When loops and abstractions in a real language help
- Ecosystem, provider, and community size
- State handling in each tool
- Team familiarity as a deciding factor
- Testing infrastructure code
- Why "boring and widely known" is often the right call
Common pitfall
Choosing Pulumi for its programming power, then building clever abstractions nobody else can follow. The expressiveness that helps can also produce infrastructure code as tangled as any application. If your team knows Terraform and the ecosystem is richer there, that familiarity often outweighs Pulumi's flexibility.
Resources
Primary (free):
- Pulumi — Documentation · docs
- Pulumi vs Terraform — Pulumi docs · docs
- Terraform — Documentation · docs
Practice
Define the same small piece of infrastructure twice — once in Terraform HCL, once in Pulumi with a language you know. Note where the programming language helped and where HCL's simplicity won. Done when you can argue which you would pick for a real team and why.
Outcomes
- Compare a declarative DSL with general-purpose IaC.
- Identify cases where a real language genuinely helps.
- Weigh ecosystem and team familiarity in the choice.
- Defend a pragmatic IaC tool decision.