Day 117: Terraform vs Ansible vs Pulumi
Terraform vs Ansible vs Pulumi
Terraform and Ansible's difference (provisioning vs. configuration) was Day 116's topic. Pulumi offers a different axis of choice: instead of HCL (Terraform's own domain-specific language), Pulumi lets you write infrastructure declarations in a real general-purpose language (TypeScript, Python, Go) — gaining real loops, functions, and your existing IDE tooling, at the cost of a less constrained, more easily over-engineered configuration surface than HCL's deliberately narrow language.
const web = new aws.ec2.Instance('web', {
ami: 'ami-0abcdef1234567890',
instanceType: 't3.micro',
});The honest trade-off
HCL's simplicity is a feature, not a limitation — it's harder to write genuinely confusing, deeply abstracted infrastructure code in a constrained DSL than in a full general-purpose language. Pulumi's power is real, but so is the risk of infrastructure code turning into unreviewable programming rather than declarative configuration.
Key terms
- Pulumi
- An infrastructure-as-code tool using general-purpose languages instead of a dedicated DSL.
What is the core trade-off between Terraform's HCL and Pulumi's general-purpose-language approach?