Dev tools

Terraform vs Pulumi: Which IaC Tool to Pick

Terraform vs Pulumi: HCL vs real programming languages, state, providers, testing, licences, OpenTofu, side-by-side code and which IaC tool fits your team.

By OmniAI Editorial · Nov 23, 2026 · 12 min read

In Terraform vs Pulumi, both tools do the same job: you describe cloud infrastructure in code, preview the changes, and the tool creates, updates or deletes real resources to match. The core difference is the language. Terraform uses HCL, a purpose-built configuration language that is deliberately simple and declarative. Pulumi lets you write infrastructure in general-purpose languages such as TypeScript, Python, Go, C# or Java, with loops, functions, classes, packages and your usual test tools.

Terraform has the larger ecosystem, more examples and more people who already know it. Pulumi fits teams that would rather use the languages and tooling they already have, and want to build higher-level abstractions in real code. Licensing has also shaped the choice since Terraform moved to a source-available licence in 2023, giving rise to the open-source fork OpenTofu. This guide compares the two on language, state, providers, testing, licensing and cost, shows the same resource in both, and ends with clear picks.

Terraform vs Pulumi at a Glance

TerraformPulumi
MakerHashiCorp (an IBM company since February 2025)Pulumi Corporation
LanguageHCL (HashiCorp Configuration Language)TypeScript, JavaScript, Python, Go, .NET (C#, F#), Java, YAML and HCL
StyleDeclarative configurationDeclarative resource model, written in imperative languages
LicenceBusiness Source License 1.1 since August 2023 (previously MPL 2.0)Apache 2.0 for the open-source engine and SDKs
Open-source forkOpenTofu, under the Linux FoundationNot needed
StateState file in a backend you choose (S3, Azure Storage, GCS, HCP Terraform and others)Pulumi Cloud by default, or self-managed backends (S3, Azure Blob, GCS, local)
ProvidersVery large registry of providers and modulesNative providers plus bridged Terraform providers
Testingterraform test, plan checks, external toolsUnit and integration tests in the language's own test frameworks
SecretsMarked sensitive; protect the state fileSecrets encrypted in state by default
Managed serviceHCP Terraform (formerly Terraform Cloud), Terraform EnterprisePulumi Cloud
Learning curveLearn HCL (small)Know a supported language already

What Is Terraform?

Terraform, released by HashiCorp in 2014, is the most widely used infrastructure-as-code tool. You write .tf files in HCL that declare resources, run terraform plan to see what will change, and terraform apply to make it so. Terraform keeps a state file that maps your code to real resources, and talks to each cloud or service through a provider plugin.

Its strengths are a huge ecosystem, a simple and readable language, and vast amounts of documentation, examples and hiring pool. Our overview of infrastructure as code covers the wider category, and Terraform vs Ansible compares it with configuration management.

What Is Pulumi?

What is Pulumi? It's an infrastructure-as-code platform, open-sourced in 2018, that lets you define infrastructure in general-purpose programming languages. Your program declares resources as objects; when you run pulumi preview and pulumi up, Pulumi's engine compares the desired state with the current state and plans the changes, much like Terraform.

Because the code is a real program, you can use loops, conditionals, functions, classes, package managers, IDE autocompletion and type checking. Pulumi also offers an Automation API, which lets you drive deployments from your own application code, for example to create an environment per customer from an internal platform.

The Same Resource in Both

Two code windows, one plain and one with tags, both pointing to one orange bucket
The same bucket in HCL and in TypeScript: the resource model is similar; the language around it differs.

An S3 bucket with versioning, created once per environment.

Terraform (HCL):

variable "environments" {
  default = ["dev", "staging", "prod"]
}

resource "aws_s3_bucket" "logs" {
  for_each = toset(var.environments)
  bucket   = "acme-logs-${each.key}"
  tags     = { env = each.key }
}

resource "aws_s3_bucket_versioning" "logs" {
  for_each = aws_s3_bucket.logs
  bucket   = each.value.id
  versioning_configuration { status = "Enabled" }
}

Pulumi (TypeScript):

import * as aws from "@pulumi/aws";

const environments = ["dev", "staging", "prod"];

for (const env of environments) {
  const bucket = new aws.s3.Bucket(`logs-${env}`, {
    bucket: `acme-logs-${env}`,
    tags: { env },
  });
  new aws.s3.BucketVersioning(`logs-${env}-versioning`, {
    bucket: bucket.id,
    versioningConfiguration: { status: "Enabled" },
  });
}

For a simple case like this, both are similar in length and clarity. The difference grows with complexity. Pulumi's TypeScript can wrap this pattern in a reusable class, publish it as an npm package and unit test it with Jest. Terraform would use a module, which is simpler to read but limited to what HCL expressions allow.

Terraform vs Pulumi: Language and Abstraction

This is the heart of the decision.

HCL (Terraform)General-purpose languages (Pulumi)
Readability for non-developersHigh: looks like configurationDepends on the language and how the code is written
Loops and conditionsfor_each, count, conditional expressionsFull language features
ReuseModulesFunctions, classes, packages, component resources
Type checking and autocompletionGood editor support for HCLFull IDE support in typed languages
Risk of over-engineeringLow; the language limits clevernessHigher; real code invites complexity
Sharing with app developersThey must learn HCLThey can use a language they already know

HCL's limits are partly a feature: infrastructure code stays predictable and easy to review. Pulumi's power is genuine but needs discipline: the same coding standards, reviews and tests you'd apply to application code.

State, Backends and Secrets

Both tools track deployed resources in state. Lose or corrupt it and the tool no longer knows what it manages.

  • Terraform stores state in a backend you configure. Remote backends with locking (an S3 bucket with locking, Azure Storage, Google Cloud Storage, or HCP Terraform) are standard for teams. Sensitive values can appear in state, so the state store must be protected.
  • Pulumi uses Pulumi Cloud by default, which handles state, locking, history and secrets, or a self-managed backend such as S3, Azure Blob Storage or Google Cloud Storage. Values marked as secrets are encrypted in state, with keys from Pulumi Cloud or your own key service.

Providers and Ecosystem

Terraform's provider registry is the largest in infrastructure as code, covering the major clouds and a long tail of SaaS products, databases and network devices. Its public module registry adds ready-made building blocks.

Pulumi offers its own providers and can use Terraform providers through a bridge, which gives it broad coverage. For the largest clouds it also has "native" providers generated directly from the cloud APIs. In practice, coverage is rarely the deciding factor for mainstream services; for niche providers, check that the Pulumi package exists and is maintained.

Testing and Policy

CapabilityTerraformPulumi
Unit teststerraform test with mocked providersLanguage test frameworks (Jest, pytest, Go test) with mocks
Integration teststerraform test, Terratest (Go)Language frameworks; Automation API for ephemeral stacks
Plan reviewterraform plan output in pull requestspulumi preview output in pull requests
Policy as codeSentinel (commercial), Open Policy AgentPulumi policy packs (CrossGuard), Open Policy Agent

Teams with strong software testing habits often find Pulumi's approach natural. Terraform's testing has improved substantially and is enough for most needs.

Terraform vs Pulumi vs OpenTofu

A line that splits at an orange node into two branches, with a separate parallel line below
Terraform moved to a source-available licence; OpenTofu continues the open-source line; Pulumi stays Apache 2.0.

On Terraform vs Pulumi vs OpenTofu: in August 2023 HashiCorp moved Terraform and its other products from the open-source Mozilla Public License 2.0 to the source-available Business Source License 1.1. The BSL permits most internal use but restricts offering competing commercial products. In response, the community forked the last open-source Terraform as OpenTofu, now hosted by the Linux Foundation under MPL 2.0. IBM completed its acquisition of HashiCorp in February 2025.

TerraformOpenTofuPulumi
LicenceBSL 1.1MPL 2.0 (open source)Apache 2.0 (open source)
LanguageHCLHCL (compatible with Terraform at fork time; diverging features since)General-purpose languages, YAML, HCL
GovernanceHashiCorp / IBMLinux FoundationPulumi Corporation
Migration from Terraform—Usually a drop-in replacement for existing codeConvert code, or import existing resources

For most companies using Terraform internally, the licence change has no practical effect. It matters if you build a product that offers Terraform-like functionality, or if your organisation requires open-source licences. OpenTofu is the lowest-effort path for teams that want to stay with HCL under an open-source licence.

Pulumi vs Terraform for Your Team

On Pulumi vs Terraform, team background decides more than features:

Team situationBetter fitWhy
Platform or ops team, mixed backgroundsTerraform (or OpenTofu)HCL is quick to learn and easy to review
Developers own their infrastructurePulumiSame language and tools as the application
Large existing Terraform codebaseTerraform or OpenTofuMigration cost rarely pays off
Building an internal developer platform with self-service environmentsPulumiAutomation API and real abstractions
Need the widest hiring pool and examplesTerraformMore people know it
Organisation requires open-source licencesOpenTofu or PulumiTerraform is now source-available
Heavy use of complex logic across many environmentsPulumiFull programming constructs

Is Pulumi Better Than Terraform?

Is Pulumi better than Terraform? The usual question, Pulumi vs Terraform which is better, has no single answer: neither is better in general. Pulumi is better for teams that think in code, want real abstractions and testing, and prefer to avoid learning a separate language. Terraform is better for teams that value a simple, constrained language, the largest ecosystem and the most familiar tool in the industry.

A practical way to decide: build the same small but real piece of infrastructure, such as a VPC, a database and a service, in both, and ask the people who will maintain it which they'd rather read in a year.

Migrating Between Them

  • Terraform to OpenTofu: usually straightforward for existing code; test with your providers and backend first.
  • Terraform to Pulumi: pulumi convert --from terraform translates HCL into a Pulumi program in your chosen language, and existing resources can be imported into Pulumi state. Recent Pulumi versions can also run HCL directly. Migrate one stack at a time.
  • Coexistence: many organisations run both, for example Terraform for shared network and account foundations and Pulumi for application-team stacks, reading outputs across tools.

A Typical Team Workflow

The day-to-day workflow is nearly identical in both tools:

StepTerraformPulumi
Change code in a branchEdit .tf filesEdit the program
Open a pull requestCI runs terraform fmt, validate and planCI runs linting, unit tests and pulumi preview
ReviewReviewers read the plan outputReviewers read the preview output
MergeCI runs terraform apply against the reviewed planCI runs pulumi up
EnvironmentsWorkspaces, directories or separate state per environmentStacks (for example dev, staging, prod) with per-stack config
Driftterraform plan shows differences from realitypulumi refresh and preview show differences

Whichever tool you use, the essentials are the same: run changes only from CI, review every plan or preview, keep state remote and locked, and give each environment its own state. Drift, where someone changes resources by hand in the cloud console, is the most common source of surprises; scheduled plans or previews that alert on differences catch it early.

Cost

Both open-source command-line tools are free. Costs come from the managed services:

  • HCP Terraform and Terraform Enterprise add remote runs, state, policy and governance on paid tiers, with a free tier for small teams.
  • Pulumi Cloud has a free individual tier and paid team and enterprise tiers, priced by usage.
  • Self-managing state (for example in an S3 bucket) avoids subscription costs for both, at the price of building your own pipelines, access control and policy checks.

Whichever tool you choose, good tagging and reviews of plans help control cloud spend. Our guide to cloud cost optimization covers the bill itself.

Writing Infrastructure Code With AI Assistants

AI coding assistants write both HCL and Pulumi programs well, because both have large amounts of public examples. Pulumi benefits from the assistants' strength in mainstream languages and type checking; Terraform benefits from its simple, repetitive syntax. In both cases the safety net is the same: never apply generated code without reading the plan or preview, check resource names and permissions, and keep policy checks in CI so a confident but wrong suggestion can't reach production.

Common Mistakes

  • Choosing on features alone instead of who will maintain the code.
  • Over-abstracting in Pulumi, so nobody can tell what infrastructure a change will create.
  • Copy-pasting Terraform instead of using modules.
  • Unprotected state files containing secrets.
  • No plan review in pull requests.
  • Migrating a large, working codebase without a clear benefit.

FAQ

Can Pulumi use Terraform providers?

Yes. Pulumi can use Terraform providers through its bridge, in addition to its own native providers.

Is Pulumi free?

The open-source Pulumi engine and SDKs are free under Apache 2.0. Pulumi Cloud has a free tier and paid plans; you can also self-manage state.

Is Terraform still open source?

No. Since August 2023, Terraform is under the Business Source License, which is source-available rather than open source. OpenTofu is the open-source fork.

Which is easier to learn?

For people new to programming, Terraform's HCL is usually easier. For developers fluent in TypeScript, Python or Go, Pulumi feels familiar immediately.

Can I use Terraform and Pulumi together?

Yes. Many teams use both, sharing outputs between stacks, and Pulumi can read Terraform state outputs.

All articles

Read next

Language

EnglishEnglish · en TürkçeTurkish · tr DeutschGerman · de العربيةArabic · ar

Account

Enter your email. We’ll send you a sign-in link and a 6-digit code. No password needed.

Sign in

Theme

Language

Show our email address

To keep spam out of our inbox, please confirm your own email first. We will send you a 6-digit code.

We send codes only to these providers: gmail.com, googlemail.com, outlook.com, hotmail.com, live.com, msn.com, proton.me, protonmail.com, pm.me, icloud.com, me.com, mac.com, yahoo.com, aol.com, gmx.de, gmx.net, web.de, t-online.de, yandex.com, omniai.blog