All Posts
Engineering November 12, 2026

Terraform vs Pulumi: Infrastructure as Code for Commerce Platforms

Terraform is the default infrastructure as code tool, and Pulumi is the credible alternative that lets you write infrastructure in a general purpose language. Add the Terraform license change and the OpenTofu fork, and the choice is less obvious than it was five years ago. Here is a practical comparison for teams running commerce platforms.

Black Friday is the best argument for infrastructure as code that has ever been made. A commerce platform that cannot be reproduced from a repository cannot be scaled, rebuilt, or audited with confidence, and the week before peak traffic is the worst possible time to discover that a load balancer setting exists only in someone's memory. Most serious teams already agree on the principle. The live argument is about the tool.

For years the answer was Terraform, and for many teams it still is. But the field has changed. Pulumi matured into a serious option with real programming languages. HashiCorp changed Terraform's license, a community fork called OpenTofu appeared, and HashiCorp itself was later acquired by IBM. If you are choosing infrastructure tooling for a commerce platform today, you are choosing among more options and more governance questions than your predecessors faced. This is a decision guide, written from the practitioner side, with the facts we are confident in stated plainly and everything volatile flagged for you to verify.

The Core Difference: A Declarative Language vs Your Language

Terraform describes infrastructure in HCL, the HashiCorp Configuration Language. HCL is declarative and deliberately limited. You write resources, variables, outputs, and modules, and Terraform works out the order of operations from the dependency graph. It has loops and conditionals through constructs like count, for_each, and expressions, but it is not a general purpose language, and that is by design. A reviewer can read a Terraform file and understand what will exist without tracing control flow.

Pulumi takes the opposite view. You write infrastructure in TypeScript, Python, Go, C#, or Java, and a YAML option exists for simple cases. Resources are objects, loops are real loops, and abstractions are ordinary functions, classes, and packages. The engine still builds a dependency graph and computes a diff before applying, so the safety model is similar, but the authoring experience is software engineering rather than configuration.

This is the real trade. HCL gives you uniformity: every Terraform codebase looks broadly alike, and an engineer who has seen one can read another. A general purpose language gives you power: you can unit test logic, share libraries through your normal package manager, generate resources from a data structure, and reuse the same type system your application team already knows. The cost of that power is variety. Two Pulumi codebases can look nothing alike, and a clever abstraction can hide what will actually be created.

State Management

Both tools track what they have created in a state file, and both will hurt you if state is mishandled.

Terraform stores state in a backend you configure. Common choices are an object storage bucket with a locking mechanism, or HashiCorp's hosted service. State can contain sensitive values in plain text, so the backend needs encryption, strict access control, and locking to prevent two applies from colliding. Splitting state into many smaller workspaces is standard practice for large estates, because a single enormous state file makes every plan slow and every mistake wide.

Pulumi also stores state in a backend. The default experience uses Pulumi Cloud, a hosted service, and you can alternatively use a self managed backend such as object storage or a local file. Pulumi encrypts secrets in state by default, which is a pleasant difference from tools that leave secrets readable unless you add protections. Projects and stacks are the organizing units, and a stack maps naturally to an environment such as staging or production.

In practical terms, neither tool escapes the operational discipline: remote state, locking, least privilege access, and a plan to recover from corruption. If a vendor hosted backend is unacceptable for compliance reasons, both can run against storage you control, though you take on more of the operational work. OpenTofu has also added native state encryption as a feature, which is worth checking if encrypted state is a requirement.

The License Change and OpenTofu

This is the part of the story that most affects governance, so it deserves precision.

Terraform was open source under the Mozilla Public License. In August 2023, HashiCorp moved Terraform and its other products to the Business Source License, which is source available rather than open source. In broad terms, it limits use of the code in products that compete with HashiCorp's offerings. For most companies that simply use Terraform to manage their own infrastructure, it is not a practical obstacle.

The community response was OpenTofu, a fork of the last open source Terraform release, originally announced as OpenTF. It is hosted by the Linux Foundation, licensed under the MPL, and governed by a foundation rather than a single company. It has shipped its own releases and features since, and it aims to stay broadly compatible with Terraform configurations and providers. Later, IBM announced and then completed its acquisition of HashiCorp, which added another variable to long term roadmap questions.

What should you take from this? First, do not panic. If you use Terraform as an end user, your day to day work continues. Second, treat licensing and governance as a real input, especially if you are a platform vendor, an agency embedding tooling in products, or an enterprise with an open source policy. Third, verify the current state before deciding: release versions, compatibility between Terraform and OpenTofu, and license terms have all been moving, and anything we state here is a snapshot. Fourth, note that Pulumi's core is open source under the Apache license, though its hosted service is a commercial product, so the governance question there is about the cloud service rather than the engine.

Testing and Quality

Here the general purpose language argument earns its keep.

With Pulumi, you can test infrastructure code using the same frameworks your application teams already use. Unit tests can mock the engine and assert that a bucket is encrypted or that no security group opens a port to the world, without creating anything. Integration tests can deploy a real ephemeral stack, check it, and tear it down. Policy as code, through Pulumi's policy framework, adds guardrails that run against every preview.

Terraform has been steadily improving here. It ships a native test command that lets you write test files in HCL, running plan or apply assertions, and OpenTofu has a comparable capability. Beyond that, teams commonly add policy engines such as Open Policy Agent or Sentinel for compliance rules, static analysis tools for misconfigurations, and integration test frameworks that deploy real resources. It works, but it is more of an assembled toolchain than a single coherent experience.

For commerce platforms, testing matters because the blast radius is revenue. A misconfigured CDN rule, a database parameter that throttles checkout, or a security group that exposes an internal service is an outage or an incident. Whichever tool you pick, run plans in pull requests, require review of the diff, enforce policy automatically, and apply only from CI rather than laptops.

Team Skill Fit and Ecosystem

Tooling choices are people choices.

Terraform has the larger ecosystem by a wide margin: a huge registry of providers and modules, extensive documentation, a deep hiring pool of engineers who list it on their resumes, and a long tail of community answers. If you need to manage an obscure SaaS product or a niche cloud service, a Terraform provider probably exists. Pulumi can use Terraform providers through a bridge, so coverage is broader than its native catalog suggests, though bridged providers can lag.

Pulumi suits teams where software engineers own infrastructure. If your backend team writes TypeScript and your platform team is small, letting them write infrastructure in the same language reduces context switching and lets them reuse validation logic, configuration types, and CI patterns. It suits teams building internal platforms, where infrastructure is exposed to developers as reusable components with typed inputs.

Terraform suits teams with dedicated operations or platform engineers who prefer a constrained, declarative surface, and organizations that want infrastructure reviewable by people who are not application developers. HCL is easy to read, and security and compliance reviewers can follow it.

Both tools have a cultural failure mode: Pulumi invites over abstraction, and Terraform invites module and workspace sprawl. Standards and code review fix both.

The Decision Framework

Dimension Terraform Pulumi OpenTofu
Language HCL, declarative TypeScript, Python, Go, C#, Java, YAML HCL, declarative
License Business Source License Apache core, commercial cloud service MPL, foundation governed
State Remote backends, hosted option Pulumi Cloud or self managed Remote backends, state encryption
Testing Native test command plus external tools Native language test frameworks, policy as code Native test command plus external tools
Ecosystem Largest Large, uses bridged providers Terraform compatible
Hiring pool Broadest Growing Same skills as Terraform
Best for Ops led teams, broad provider needs Developer led teams, internal platforms Teams wanting open governance

Choose Terraform when you have operations or platform engineers who value a uniform, reviewable language, when you need the widest provider and module coverage, and when hiring familiarity matters. Choose OpenTofu when you want that same workflow with open governance, particularly if your organization has an open source policy or you build products on the tooling. Choose Pulumi when software engineers own infrastructure, when you want real unit tests and shared libraries, and when you are building reusable platform components. If you are migrating from an older estate, our monolithic to composable commerce roadmap shows where infrastructure fits in the sequence, and Datadog versus New Relic covers monitoring what you provision.

What This Means for Your Business

The business consequences of this choice show up in three places. The first is delivery speed: a team working in its native language ships infrastructure changes faster, and a team working in an unfamiliar one ships slower and makes more mistakes. The second is risk: whichever tool you pick, the discipline of plan review, policy checks, and CI only applies decides your incident rate far more than the tool does. The third is optionality: governance and licensing questions affect how freely you can build, resell, or embed your tooling later.

Do not underestimate migration cost. Moving between these tools is possible, since resources can be imported into new state, but it is a project, and a risky one for production systems. Pick deliberately, standardize early, and avoid running two tools across the same estate unless there is a clear boundary between them.

How Contra Collective Bridges the Gap

Contra Collective designs and builds infrastructure foundations for commerce platforms, including environment layout, state strategy, CI pipelines with plan review and policy gates, and migrations between tools. We pick the tooling that fits your team's skills and your governance requirements, not the one we happen to like. If you are weighing Terraform, OpenTofu, and Pulumi for a rebuild or a replatform, talk to our team.

Final Thoughts

Terraform is still the safe, well supported default, and its large ecosystem and hiring pool are real advantages. OpenTofu is the answer if open governance matters to you. Pulumi is the answer if your engineers want to treat infrastructure as software, with real tests and shared libraries. None of them rescues a team without remote state, locking, reviewed plans, and automated applies. Verify the current license terms and version details before you commit, choose the tool your team will actually use well, and invest the saved energy in the practices that keep checkout up on the busiest day of the year.

[ 02 ] — Keep Reading

More from the lab.

Nov 29, 2026 Engineering

Bun vs Node.js: Runtime Decisions for Production Storefronts

Bun is fast, pleasant, and increasingly capable, but a production storefront runtime is a risk decision, not a speed contest. The smartest teams adopt Bun in layers, starting with tooling and moving to production only when the evidence supports it. Here is a practical way to decide.

Nov 27, 2026 Engineering

Turborepo vs Nx: Monorepo Tooling for Storefront Teams

Turborepo and Nx both promise faster builds and saner monorepos, but they push you toward different working styles. For storefront teams sharing a design system across several brands, the choice shapes CI time and governance for years. Here is how to pick.

Ready when you are

Want to discuss this topic?

Start a Conversation