IBRAVRA Media Network
Comparisons • 12 min read

Ansible vs Terraform vs Pulumi: The Infrastructure-as-Code Playbook

Three tools provision the same cloud three different ways: Terraform declares the end state in HCL, Ansible walks the machine through YAML steps, and Pulumi writes the infrastructure in a real programming language. The choice locks in your state file, your billing meter, and your hiring profile — this playbook prices all three at 500, 1,000, and 5,000 resources so the decision is arithmetic, not taste.

By Enow A. Jovial • Published 2026-11-21

The choice that outlives the project

A three-person team provisions 800 cloud resources: virtual machines, databases, load balancers, DNS records, IAM roles. The first month, all three tools do the job. The twelfth month, the choice shows up in three places at once: the monthly bill, the morning the state file corrupts, and the job posting that takes six weeks to fill because it demands a language nobody on the team writes.

This playbook compares the three tools on those three axes, with reproducible cost math at 500, 1,000, and 5,000 managed resources, drawn from the vendors' own pricing pages read on 2026-11-21. The Terraform versus Pulumi versus AWS CDK pricing guide prices the same two tools against a cloud-native third option; this guide answers the different question of which tool model to adopt — declarative, procedural, or general-purpose — and what each model costs to operate.

The language decision is the durable one. You can migrate a state file in a weekend; you cannot retrain a team or rewrite 800 resources in a new language in a weekend. Pick the tool whose language your team already writes, then price the tiers.

Three tools, three languages

Terraform speaks HCL, the HashiCorp Configuration Language: a declarative language where you write the end state you want and the tool works out the steps. A resource block says "there is a virtual machine of this size in this region," and Terraform creates it, or changes it, or destroys it to match. HCL is small on purpose — no loops beyond count and for_each, no functions beyond the built-ins — which makes it easy to read and hard to write complex logic in.

Ansible speaks YAML playbooks: a procedural language where you write the steps in order. A play targets a group of hosts, and each task calls a module — yum, template, service — that performs one action. The playbook runs top to bottom, task by task, host by host. Ansible's own documentation puts it plainly: playbooks provide "a repeatable, reusable, simple configuration management and multimachine deployment system," expressed in YAML "with a minimum of syntax."

Pulumi speaks a general-purpose language: TypeScript, Python, Go, C#, Java, or YAML. The infrastructure is ordinary code, so loops, conditionals, functions, classes, and unit tests all work the way they work everywhere else in your codebase. A Pulumi program that provisions ten identical databases is a for loop, not ten copied blocks.

DimensionTerraform (HCL)Ansible (YAML)Pulumi (TypeScript / Python / Go / C# / Java)Authority
ModelDeclarative end stateProcedural ordered stepsDeclarative end state, written in codeVendor documentation, all three
Abstractioncount / for_each, modulesRoles, includes, loopsLoops, functions, classes, packagesVendor documentation, all three
Testingterraform plan, terratest--check mode, ansible-lint, MoleculeUnit tests in the host languagedocs.ansible.com; HashiCorp docs; Pulumi docs
AgentNone on the targetAgentless over SSH / WinRMNone on the targetdocs.ansible.com; HashiCorp docs
Learning curveDays for HCL basicsHours for YAML basicsZero for a developer who knows the languageEditorial analysis of the three docs
Hiring poolLargest of the threeLarge in operations teamsSmallest, but any developer qualifiesEditorial analysis, 2026-11-21

State: the file that remembers

Every declarative tool needs memory. Terraform keeps it in a state file — a JSON document mapping each resource in your configuration to the real resource in the cloud. Without state, Terraform cannot tell a resource it created from one that already exists. The state file is the single most important file in a Terraform estate, and the first operational decision is where it lives: a remote backend with locking and versioning, such as HCP Terraform or an S3 bucket with locking, from day one. A state file on a laptop is a data-loss incident waiting for a hardware failure.

Pulumi keeps its state in Pulumi Cloud by default, or in a self-managed backend — an S3 bucket, an Azure Blob container, a Google Cloud Storage bucket, or the local filesystem. The free Individual tier includes state management in Pulumi Cloud for one user, which is why solo developers rarely think about state until they add a second teammate. The self-managed backend is the escape hatch: the state is yours, in your bucket, and Pulumi Cloud becomes optional.

Ansible keeps no state. That is its defining architectural difference. A playbook does not remember what it did last time; it re-asserts the desired configuration on every run. Most Ansible modules are idempotent — they check whether the desired final state has already been achieved and exit without performing any actions if it has. The documentation states it directly: "Whether you run a playbook once or multiple times, the outcome should be the same." The cost of statelessness is that Ansible cannot tell you what changed in the cloud outside its runs, and it cannot plan a destroy of everything it manages. The benefit is that there is no state file to corrupt, lock, or lose.

Ansible documentation on desired state and idempotency, showing the idempotent module behavior and check mode
Ansible documentation on desired state and idempotency, showing the idempotent module behavior and check mode
Losing a Terraform state file is a recovery project, not a minor inconvenience. Terraform will try to create resources that already exist, which fails on name collisions, or plan to destroy resources it cannot see. Recovery is one terraform import per resource. Put state in a remote backend with locking and versioning on the first day, before the first resource, and test the restore before you need it.

The money: reproducible cost math

The three tools meter different things. HCP Terraform meters managed resources, billed hourly on the peak count in each hour. Pulumi Cloud meters managed resources too, but inside a flat monthly subscription with an included allowance. Ansible-core meters nothing — the license is free, and the cost is the control node and your time.

HCP Terraform's published tiers, corroborated across independent November 2026 reads of HashiCorp's pricing page (the page itself renders client-side): Free covers up to 500 managed resources; Essentials is $0.10 per resource per month ($0.00013 per hour); Standard is $0.47 per resource per month ($0.00064 per hour); Premium is $0.99 per resource per month ($0.00135 per hour). Concurrent runs rise with the tier: 1 for Free, 3 for Essentials, 10 for Standard, 200 for Premium.

Pulumi Cloud's published tiers, read directly from pulumi.com/pricing on 2026-11-21: Free is $0 for one user with state management and 500 workflow minutes; Essentials is $40 per month for unlimited users, including 40 credits and up to 500 managed resources, with each additional managed resource at $0.00025 per hour ($0.1825 per month); Pro is $400 per month with managed resources from $0.0005 per hour ($0.365 per month); Enterprise is custom pricing. Delivery pipelines are $20 per pipeline per month with the first free.

The monthly cost at a given resource count R, on the paid tiers, is:

HCP Standard=R×$0.47\text{HCP Standard} = R \times \$0.47
Pulumi Essentials=$40+max⁡(0,R−500)×$0.1825\text{Pulumi Essentials} = \$40 + \max(0, R - 500) \times \$0.1825
Ansible-core=$0 license+control-node cost\text{Ansible-core} = \$0\ \text{license} + \text{control-node cost}
Managed resourcesHCP Terraform StandardPulumi Cloud EssentialsAnsible-core licenseAuthority
500$0 (Free tier)$40/mo$0HashiCorp pricing; Pulumi pricing
1,000$470/mo ($5,640/yr)$131.25/mo ($1,575/yr)$0$0.47 × 1,000; $40 + 500 × $0.1825
5,000$2,350/mo ($28,200/yr)$861.25/mo ($10,335/yr)$0$0.47 × 5,000; $40 + 4,500 × $0.1825
5,000 (top tier)$4,950/mo Premium$2,042.50/mo Pro$0$0.99 × 5,000; $400 + 4,500 × $0.365

Three facts fall out of the table. First, Pulumi Essentials is cheaper than HCP Standard at every scale above 500 resources, because the per-resource rate is lower and the first 500 are included. Second, Ansible's license cost is zero at every scale — its cost is operational: the control node, the time to write and maintain playbooks, and the absence of a hosted state service. Third, the free tiers are real but capped: HCP Terraform Free stops at 500 resources, and Pulumi Free stops at one user. A team of two running 600 resources pays on both platforms from the first month. Run the same arithmetic through the ROI calculator to annualise the saving against the migration cost before switching tools for price alone.

Price the paid tier on day one, even while you are on the free tier. The free tier is a trial with a known expiry: 500 resources for HCP Terraform, one user for Pulumi. The day the team grows past the cap, the bill starts at the full per-resource rate — budget it in the quarter you cross the line, not after the invoice arrives.

Drift, policy, and secrets

Drift is the gap between what the code says and what the cloud actually contains — a console edit, a manual scaling change, a support ticket that resized a database. Terraform refreshes state before every operation, so every terraform plan shows the drift in its diff, on every tier; scheduled drift detection inside HCP Terraform is a Standard-and-above feature. Pulumi is the opposite by design: it does not refresh state before every operation, because querying every resource would add latency on large stacks — instead it compares the recorded state with the program, and scheduled drift detection with optional remediation is a Pulumi Cloud Pro feature. Ansible detects drift differently: it does not track cloud state, so you run a playbook in check mode — ansible-playbook --check — which reports the changes it would make without applying them. Check mode is the Ansible answer to a plan, and it is free.

Policy follows the same tiering. Terraform's policy enforcement (Sentinel) and cost estimation arrive on Standard; Pulumi's organization-managed policy enforcement and preventative policies arrive on Pro, with advisory-only results on Essentials; Ansible's policy is ansible-lint and code review, which cost nothing but require discipline. Secrets follow the same pattern: Terraform leans on Vault or the cloud secret store; Pulumi has its own encrypted secrets and ESC, with on-demand secrets at $0.50 per secret per month on Essentials; Ansible has Ansible Vault, which encrypts variables inside the repository at no extra cost.

The decision matrix

Your situationPickWhyAuthority
Team writes TypeScript / Python / GoPulumiZero new language; unit tests in the host language; cheapest paid tier above 500 resourcesPulumi pricing; editorial analysis
Team is operations-led, hiring for cloud skillsTerraformLargest hiring pool; HCL is the default IaC skill; widest provider coverageHashiCorp pricing; editorial analysis
Job is configuring machines you already ownAnsibleAgentless, YAML, idempotent, no state file, no per-resource meterdocs.ansible.com
Estate under 500 resources, one engineerAny Free tierHCP Free or Pulumi Free both cost $0; decide on language, not priceHashiCorp pricing; Pulumi pricing
Regulated, audit logs requiredHCP Premium or Pulumi ProAudit logging is a paid-tier feature on both; do not improvise itHashiCorp pricing; Pulumi pricing
Multi-cloud with one codebaseTerraform or PulumiBoth are cloud-agnostic; Ansible is strongest inside the machine, not across cloudsVendor documentation, all three

Who should NOT use each tool

Terraform is the wrong pick when the team has no one who will own the state file. If state lives on a laptop, or if nobody understands locking, the first concurrent apply will corrupt it, and the recovery is manual. Do not adopt Terraform as a solo side project with state on disk and no backend — use Pulumi Free, where the state is hosted for you.

Ansible is the wrong pick when the estate is mostly cloud-native resources that are created and destroyed daily. Ansible configures machines; it does not plan a destroy of 800 cloud resources, and it has no graph of dependencies between a VPC, a subnet, and a database. Provisioning that estate in Ansible means writing the dependency ordering by hand, in YAML, and maintaining it forever.

Pulumi is the wrong pick when the team cannot agree on one language. Pulumi's strength is that the infrastructure is code in a language the team knows; if half the team writes TypeScript and half writes Python, the estate splits into two codebases with two skill silos. Pick one language for the whole estate and enforce it in review, or pick Terraform's single HCL instead.

The adoption checklist

  • [x] Language chosen — the team writes it already; no new language for this project.
  • [x] State backend live — remote, locked, versioned, restore tested, before the first resource.
  • [x] Paid tier priced — the cost at 500, 1,000, and 5,000 resources is in the budget, not discovered on an invoice.
  • [x] Drift run scheduled — a weekly plan or check-mode run, with the diff reviewed, not just run.
  • [x] Secrets out of the repository — Vault, ESC, or Ansible Vault; no plaintext secret has ever been committed.
  • [x] Destroy tested in staging — the tool can tear down everything it built, and someone has watched it do so.

Three mistakes that cost an estate

  1. State on a laptop. Adopting Terraform with state on a laptop: the second apply from a second machine creates a split-brain state, and the merge is manual.
  2. Provisioning cloud in Ansible. Provisioning cloud resources in Ansible: the playbook grows into a hand-maintained dependency graph, and the first destroy is a week of manual console deletions.
  3. Choosing on price alone. Choosing on price alone and ignoring the hiring row: the cheapest tool per resource is expensive if it takes six weeks to hire someone who can operate it.

The Docker versus Kubernetes versus Amazon ECS pricing guide prices the infrastructure the pipelines deploy into, and the OpenTofu migration playbook covers the exit if the license terms ever change your calculus.

Founder & CEO Insight — Enow A. Jovial

"The tool is not the architecture — the state file is. Whoever owns the state owns the estate, and whoever pays the meter should have priced it before the first resource, not after the first invoice. Pick the language your team already writes, put the state somewhere it cannot be lost, and let the bill be arithmetic."
— Enow A. Jovial, Founder & Chief Executive Officer