# Client says "no Terraform"? The reason decides Pulumi or OpenTofu

> A client worried about licensing needs a different tool from a team that wants to write infrastructure in a real programming language, so ask first.

Original: https://fdetimes.net/en/tools/pulumi-vs-opentofu-no-terraform/

On August 25, 2023, after HashiCorp moved Terraform to the BSL license and did not respond to the community's appeal, a group of engineers announced a fork of Terraform. That fork is now OpenTofu, backed by the Linux Foundation.

For an FDE, a client who says "we don't want to use Terraform" can easily be misread. Some clients are wary of the license. Others are wary of HCL because their team is made up of Python engineers and nobody wants to learn another configuration language. The two reasons lead to two different tools, and choosing the wrong one can cost you the first few weeks of an engagement.

## The first question is "why not?"

Before recommending a tool, ask the client what about Terraform worries them. If the answer involves legal, procurement or the company's open-source policy, you almost certainly need OpenTofu. If the answer is "the platform team can't read HCL" or "we want to test infrastructure the way we test code," look at Pulumi.

Pulumi supports HCL as well, so the real dividing line lies elsewhere. A client who is "wary of HCL" actually wants to write infrastructure in a general-purpose programming language, and that is the reason to choose Pulumi.

Asking this way also gives you a reason, in the client's own words, to record in the design document. Three months later, when someone asks why this tool was chosen, the answer is already written down.

## OpenTofu keeps HCL and changes only the steward

OpenTofu describes itself as a community-driven tool under the Linux Foundation and a drop-in replacement for Terraform. Code is still written in HCL. The license is MPL 2.0. For a client with hundreds of `.tf` files, this is the least disruptive path: their team has nothing to relearn.

Version 1.7, released on April 30, 2024, added state encryption to encrypt state files at rest. Terraform does not have this feature. If your client works in finance or healthcare and worries about secrets sitting in state, this is a concrete argument to bring to the meeting with the security team.

The trade-off is that you must manage OpenTofu's state yourself. Who owns the backend, who may read it, how state is locked: all of that falls to you and the client's team.

## Pulumi turns infrastructure into real code

Pulumi officially supports TypeScript, JavaScript, Python, Go, .NET, Java, YAML and HCL. Its value lies in letting you use loops, functions, packages and a familiar IDE. The sketch below illustrates the idea: a Python loop creates buckets for three environments instead of copying three configuration blocks.

```python
# infra.py
import pulumi
import pulumi_aws as aws

buckets = [aws.s3.Bucket(f"raw-data-{env}") for env in ["dev", "staging", "prod"]]
```

The second thing a client's software team tends to like is testing. Pulumi unit tests are written in the program's own language and use ordinary test and mocking frameworks, so Python engineers can use pytest as they do every day. A sketch of a test for the file above might look like this:

```python
# test_infra.py
import pulumi

class Mocks(pulumi.runtime.Mocks):
    def new_resource(self, args):
        # No real cloud calls: return a fake id and pass the inputs through
        return [args.name + "_id", args.inputs]

    def call(self, args):
        return {}

pulumi.runtime.set_mocks(Mocks())

import infra

def test_creates_one_bucket_per_env():
    assert len(infra.buckets) == 3
```

This test checks the program's logic: whether the loop creates all three buckets and whether names follow the convention. Pulumi's documentation is also clear about the limit: unit tests cannot check how real infrastructure behaves. A bucket that passes a mocked test can still be blocked by a policy on the cloud account.

Pulumi's CLI and SDKs are licensed under Apache 2.0. State, however, is managed on Pulumi Cloud by default. With a client that has strict data-residency requirements, raise this in the first meeting rather than letting it surface during the security review.

**Key point:** Choose the infrastructure tool by why the client is wary of the old one, not by your own preference.

## What about the existing Terraform codebase?

Few clients start from scratch. Pulumi offers three routes for this case. You can convert HCL code into a Pulumi language, use existing Terraform modules directly inside a Pulumi program, or generate a typed local SDK from any Terraform provider, usable from every language Pulumi supports.

Pulumi says that for most projects its converter handles 90-95% of the code without leaving TODOs. That figure comes from the vendor itself, and its comparison page is also written by Pulumi, including the claim that using Pulumi does not force you to give up HCL.

Do not commit to any figure with a client before running a trial on their real modules. The places where the converter leaves TODOs are the parts you must write by hand, so count and estimate them before reporting a timeline.

## What to learn first

If you have to pick one thing to learn first, learn HCL. Both OpenTofu and Pulumi can read HCL, and every route from Terraform to Pulumi starts with reading and understanding existing HCL code. Then write a small Pulumi project in your strongest language, with unit tests, and put it on GitHub.

On your CV, don't just write "Terraform, Pulumi." Write one line saying which tool you chose, for which client, and why.

Any engineer can learn a tool's syntax. The question of why a client doesn't want Terraform is where an FDE proves their worth, from the first week.

**Try this week:**

- Install OpenTofu, point it at a small existing Terraform directory and run plan to see whether the drop-in claim holds for your code
- Write a Pulumi program in Python that uses a loop to create three identical resources for dev, staging and prod, with a unit test that uses mocks
- Run the Terraform-to-Pulumi converter on a real module, count the TODOs left and note which parts must be written by hand

## Sources

- [Languages & SDKs](https://www.pulumi.com/docs/iac/languages-sdks/)

- [OpenTofu (Pulumi docs)](https://www.pulumi.com/docs/iac/concepts/vs/opentofu)

- [Terraform (Pulumi migration guide)](https://www.pulumi.com/docs/iac/guides/migration/migrating-to-pulumi/from-terraform/)

- [Testing (Pulumi docs)](https://www.pulumi.com/docs/iac/guides/testing/)

- [OpenTofu](https://opentofu.org/)

- [Manifesto | OpenTofu](https://opentofu.org/manifesto/)

- [OpenTofu Launches 1.7 Release Including Long-Requested State Encryption](https://www.linuxfoundation.org/press/opentofu-launches-1-7-release-including-long-requested-state-encryption)
