Terraform vs OpenTofu vs Pulumi: Which IaC Tool Should You Use?
December 5, 2026 · 11 min read

Terraform vs OpenTofu is one of the most common infrastructure decisions teams face, and Pulumi is the third serious option. All three let you define cloud infrastructure, such as networks, databases, clusters and permissions, as code you can review, version and repeat, instead of clicking through consoles. They differ in licence, language, governance and features, and those differences have grown since the two HCL-based tools split in 2023.
The picture in November 2026: Terraform 1.16 shipped in August, OpenTofu 1.13 at the end of September, and Pulumi now supports Terraform's HCL language alongside general-purpose languages. This guide compares the three side by side, shows the same infrastructure in each, and gives a clear recommendation for different teams.
How Infrastructure as Code Works
All three tools follow the same basic idea. You describe the infrastructure you want; providers translate that description into calls to cloud and service APIs; the tool compares your description with what already exists, recorded in its state, and shows a plan of what it will create, change or destroy. You review the plan, apply it, and the state is updated. Because the description lives in Git, every change is reviewed, repeatable and reversible, and you can rebuild an environment from scratch with confidence.
Quick Comparison
| Terraform | OpenTofu | Pulumi | |
|---|---|---|---|
| Licence | Business Source License 1.1 | MPL 2.0 (open source) | Apache 2.0 (open source engine) |
| Governance | HashiCorp, an IBM company | Linux Foundation community project | Pulumi Corporation |
| Language | HCL | HCL | TypeScript, Python, Go, C#, Java, YAML and HCL |
| Providers | Terraform Registry | OpenTofu Registry, same providers | Native and bridged Terraform providers |
| State encryption | Relies on the storage back end | Built-in client-side encryption | Secrets encrypted in state by default |
| Managed service | HCP Terraform and Terraform Enterprise | Third-party platforms | Pulumi Cloud, or self-managed back ends |
| Best for | Teams invested in HashiCorp's platform | Teams wanting open-source HCL | Teams wanting real programming languages |
The Licence Split Explained
Terraform was open source until August 2023, when HashiCorp moved its products to the Business Source License. The BSL allows most internal use but restricts offering products that compete with HashiCorp. In response, the community forked the last open-source version as OpenTofu, now a Linux Foundation project. IBM completed its acquisition of HashiCorp in February 2025. For most companies that simply use Terraform to manage their own infrastructure, the licence change has little practical effect; for vendors building infrastructure products, it matters a great deal. This is not legal advice, so check the licence against your own use.
Same Code, Two Tools
Terraform and OpenTofu share the HCL language and the provider ecosystem, so most configurations run unchanged in either. This example creates a private S3 bucket for an environment:
# main.tf - works unchanged with Terraform and OpenTofu
terraform {
required_version = ">= 1.10"
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 6.0"
}
}
}
provider "aws" {
region = var.region
}
variable "region" {
type = string
default = "eu-west-2"
}
variable "environment" {
type = string
description = "Deployment environment, for example staging or production"
}
resource "aws_s3_bucket" "assets" {
bucket = "acme-assets-${var.environment}"
tags = {
Environment = var.environment
ManagedBy = "terraform"
}
}
resource "aws_s3_bucket_public_access_block" "assets" {
bucket = aws_s3_bucket.assets.id
block_public_acls = true
block_public_policy = true
ignore_public_acls = true
restrict_public_buckets = true
}
output "bucket_name" {
value = aws_s3_bucket.assets.bucket
}
The workflow is the same in all three tools: initialise, preview the changes, then apply them:
# The same workflow, three tools
terraform init && terraform plan -var environment=staging && terraform apply -var environment=staging
tofu init && tofu plan -var environment=staging && tofu apply -var environment=staging
pulumi stack init staging && pulumi config set environment staging && pulumi up
OpenTofu began as a drop-in replacement for Terraform 1.5 and remains compatible for most everyday configurations, but each tool has since added features the other lacks, so check any newer feature you depend on before switching.
What Terraform Offers in 2026
Terraform's recent releases have focused on lifecycle and module improvements:
- Terraform 1.14 (late 2025) added list resources and a query command for finding existing infrastructure, plus actions for running provider operations.
- Terraform 1.15 (April 2026) brought dynamic module sources, a formal deprecation mechanism for variables, an inline
convertfunction and Windows ARM64 builds. - Terraform 1.16 (August 2026) added destroy-time actions, configurable failure handling for actions and imports inside child modules.
HCP Terraform, the managed service, adds remote runs, policy as code, Stacks for managing many deployments, private registries and cost features. Its legacy free plan ended on 31 March 2026, and organisations moved to an enhanced free tier that includes 500 managed resources, single sign-on and policy checks. One casualty: HashiCorp archived CDK for Terraform, which let teams write Terraform in TypeScript or Python, in December 2025.
What OpenTofu Offers
OpenTofu's headline feature is client-side encryption of state and plan files, which can contain database passwords and other secrets. It is configured in code:
# encryption.tf - OpenTofu only: encrypt state and plan files on the client before they are stored
variable "state_passphrase" {
type = string
sensitive = true
}
terraform {
encryption {
key_provider "pbkdf2" "main" {
passphrase = var.state_passphrase # at least 16 characters; a cloud KMS key provider is better in production
}
method "aes_gcm" "main" {
keys = key_provider.pbkdf2.main
}
state {
method = method.aes_gcm.main
}
plan {
method = method.aes_gcm.main
}
}
}
With this block, OpenTofu encrypts state and plans with AES-GCM before writing them anywhere, so a leaked state file or a misconfigured storage bucket does not expose secrets. In production, use a key provider backed by a cloud key management service rather than a passphrase. Other OpenTofu additions include provider-defined functions, for_each on providers, early evaluation of variables in more places, and, in OpenTofu 1.11, ephemeral resources that keep temporary secrets out of state and an enabled argument for switching resources on and off. OpenTofu 1.13 added official Windows ARM64 builds, functions that reduce unknown values at plan time and experimental built-in linting, and is supported until August 2027.
What Pulumi Offers
Pulumi lets you write infrastructure in general-purpose languages. Here is the same bucket in TypeScript:
// index.ts - the same infrastructure as a Pulumi program in TypeScript
import * as aws from "@pulumi/aws";
import * as pulumi from "@pulumi/pulumi";
const config = new pulumi.Config();
const environment = config.require("environment");
// Ordinary code: loops, functions and types work as they do in any TypeScript project
const assets = new aws.s3.Bucket("assets", {
bucket: `acme-assets-${environment}`,
tags: { Environment: environment, ManagedBy: "pulumi" },
});
new aws.s3.BucketPublicAccessBlock("assets", {
bucket: assets.id,
blockPublicAcls: true,
blockPublicPolicy: true,
ignorePublicAcls: true,
restrictPublicBuckets: true,
});
export const bucketName = assets.bucket;
Because it is ordinary code, you can use loops, functions, classes, packages and the testing tools your developers already know, and IDEs autocomplete every resource property. Pulumi encrypts secrets in state by default, offers Pulumi ESC for managing secrets and configuration, and has added AI features such as its Neo agent. In January 2026 it added native support for Terraform and HCL, so teams can mix HCL and programming languages in one platform. Its release notes show a steady pace of provider and platform updates.
State, Secrets and Collaboration
All three tools record what they created in a state file, which must be stored remotely, locked during changes and protected. Never commit state to Git, restrict who can read it and split large estates into smaller states so one mistake cannot affect everything. Run plans automatically on pull requests so reviewers see exactly what will change; our GitHub Actions tutorial shows a pipeline you can extend, and our guide to CI/CD covers the wider practice.
Testing Infrastructure Code
Infrastructure code deserves tests too. Terraform and OpenTofu both include a native test framework, terraform test and tofu test, that can run plans or temporary deployments and check assertions, with mocked providers for fast unit tests. Pulumi programs can use the language's normal test tools, with mocks for cloud calls, plus property tests and policy packs. Whichever tool you use, add policy checks for security rules, such as encryption and public access, and spin up short-lived preview environments for risky changes.
Pricing in Practice
The command-line tools are free to use. Costs come from collaboration platforms: HCP Terraform charges beyond its free tier based on managed resources, Pulumi Cloud has a free individual tier and paid team and enterprise tiers, and OpenTofu users either run plans in their own CI or use third-party platforms such as Spacelift, env0, Scalr or Harness, which also support Terraform and Pulumi. Compare the total cost, including the engineering time to run your own pipelines, rather than licence fees alone.
AI and Infrastructure as Code
AI assistants now draft infrastructure code, explain plans and suggest fixes in all three ecosystems, and Pulumi has built an agent into its platform. They speed up routine work, but infrastructure mistakes are expensive, so treat generated code like any other change: review the plan, run policy checks and apply through CI.
Terraform vs OpenTofu vs Pulumi: Which Should You Choose?
- Choose Terraform if you already rely on HCP Terraform or Terraform Enterprise, want commercial support from HashiCorp and IBM, or need features such as Stacks.
- Choose OpenTofu if you want an open-source licence with community governance, built-in state encryption, or you build products or services on top of your infrastructure tooling.
- Choose Pulumi if your team is made up mainly of software developers, your infrastructure needs complex logic, or you want to test infrastructure with ordinary unit tests and build internal platforms programmatically.
For most teams starting fresh with HCL, OpenTofu and Terraform are both safe choices, and the skills transfer between them. Infrastructure as code remains one of the highest-paying IT skills, whichever tool you pick.
Migrating Between Tools
- Terraform to OpenTofu: install OpenTofu, run
tofu initin an existing project, and confirm thattofu planshows no changes before applying. Check the compatibility notes for your Terraform version first. - Terraform to Pulumi: Pulumi's converter can translate HCL into a supported language, and its import tools can adopt resources from existing Terraform state.
- CDK for Terraform users: move to plain HCL, to Pulumi, or evaluate CDK Terrain, a community fork, bearing in mind the risks of depending on a small project.
Infrastructure as Code Best Practices
- Use modules or components for repeated patterns, with versioned releases.
- Keep environments in separate states, with identical code and different variables.
- Review plans in pull requests and apply only from CI, never from laptops.
- Enforce policies as code, such as required tags, encryption and allowed regions.
- Detect drift regularly, so manual console changes do not go unnoticed.
- Tag everything for cost allocation; see our guide to cloud cost optimisation.
Infrastructure as code is the foundation for running Kubernetes clusters reliably and for the self-service golden paths described in our guide to platform engineering. Our DevOps roadmap shows where it fits in a DevOps career.
Frequently Asked Questions
What is the difference between Terraform and OpenTofu?
OpenTofu is an open-source fork of Terraform created after HashiCorp changed Terraform's licence in 2023. Both use HCL and the same providers, but OpenTofu adds features such as state encryption, while Terraform integrates with HashiCorp's commercial platform.
Is OpenTofu a drop-in replacement for Terraform?
For most configurations, yes. It started as a drop-in replacement for Terraform 1.5, but the projects have since diverged, so check newer features you rely on before switching.
Is Terraform still free?
The Terraform CLI is free to use under the Business Source License, which restricts building competing products. HCP Terraform has a free tier with up to 500 managed resources and paid tiers beyond that.
Is Pulumi better than Terraform?
Neither is better for everyone. Pulumi suits teams who want general-purpose languages and testing; Terraform and OpenTofu suit teams who prefer HCL's declarative style and its very large community.
Can I use Terraform providers with Pulumi?
Yes. Pulumi bridges many Terraform providers, can reference Terraform modules and, since 2026, supports HCL itself.
What happened to CDK for Terraform?
HashiCorp deprecated and archived CDK for Terraform in December 2025. Teams are moving to plain HCL, to Pulumi or to community forks.
Automate Your Infrastructure
We build and migrate infrastructure as code with Terraform, OpenTofu and Pulumi, including CI pipelines, policies and secure state management. Contact our team to modernise your infrastructure.