5 min read

IaC Beyond Terraform - OpenTofu, the Fork That Became a Serious Alternative

1. A New Series: The World Beyond Terraform

In the previous series on this blog, we explored in depth how to combine Terraform and YAML to manage infrastructure across multiple environments. Terraform is by far the most popular Infrastructure as Code (IaC) tool on the market — but it’s far from the only relevant piece of the ecosystem. In this new series, we step out of the pure-Terraform bubble and look at tools that complement (or, in some cases, compete with) it: OpenTofu, Ansible, and the testing tools that make sure infrastructure code actually does what it promises.

We start with the case closest to home: OpenTofu, a direct fork of Terraform that was born out of a licensing crisis and is now a Linux Foundation project with a life of its own.

2. Why a Fork Happened

In August 2023, HashiCorp announced that all of its products, including Terraform, would stop using the Mozilla Public License 2.0 (MPL 2.0) — an open source license recognized by the OSI (Open Source Initiative) — and would move to the Business Source License (BSL) 1.1.

In practice, the BSL prohibits third parties from using HashiCorp’s code to build products or services that compete directly with HashiCorp’s own products. This hit hard companies that offered state management platforms, pipeline automation and “Terraform as a Service” built on Terraform’s open source code — suddenly, their business models were legally uncertain.

The community reacted quickly. In September 2023, a group of companies (including Spacelift, Env0, Gruntwork, Harness and others) announced OpenTF, a fork of the last Terraform release under the original MPL 2.0 — freezing the code at the exact point before the license change. Shortly afterwards, the project was donated to the Linux Foundation and renamed OpenTofu, gaining neutral governance and a roadmap independent of HashiCorp. [1]

3. What OpenTofu Is, in Practice

OpenTofu is not a competing product that reimplements Terraform’s ideas from scratch — it’s literally the same source code, maintained by an open community from the point where it diverged. This means that, for anyone already using Terraform, the learning curve to migrate is close to zero:

  • The syntax is HCL (HashiCorp Configuration Language), identical.
  • Providers (AWS, GCP, Azure, Kubernetes, etc.) keep working — OpenTofu consumes the same Terraform Registry by default, and also maintains its own mirrored registry.
  • The state file format is compatible.
  • The commands are practically the same, swapping the terraform binary for tofu:
tofu init
tofu plan
tofu apply
tofu destroy

4. Practical Differences That Already Exist Today

Despite being compatible, OpenTofu hasn’t stood still — the project has already shipped features Terraform doesn’t have yet (or took longer to release):

  • Native state encryption: OpenTofu lets you encrypt the state file at rest and in transit using user-managed keys, without depending on a backend that already does it (like an S3 bucket with server-side encryption). This is configured directly in the terraform block:
terraform {
  encryption {
    key_provider "pbkdf2" "mykey" {
      passphrase = var.state_encryption_passphrase
    }

    method "aes_gcm" "example" {
      keys = key_provider.pbkdf2.mykey
    }

    state {
      method = method.aes_gcm.example
    }
  }
}
  • for_each in provider blocks: lets you dynamically instantiate multiple configurations of the same provider (for example, one AWS credential per account in a list), something that in Terraform requires declaring each alias by hand.

  • Alternative, distributed registry: the OpenTofu Registry works independently of the Terraform Registry, reducing the single-point-of-failure risk for anyone relying on public providers and modules.

In the day-to-day of a typical Terraform module — resources, variables, outputs, for_each, count, nested modules — there’s no noticeable difference.

5. When Migrating Makes Sense

  • Concerns about the licensing model: if your company builds products or services on top of IaC (internal self-service platforms, automation tools) and wants to avoid any legal ambiguity with the BSL, OpenTofu removes that concern by being under MPL 2.0.
  • You already use the plain Terraform CLI, without depending on features exclusive to Terraform Cloud/Enterprise (such as Sentinel for policy as code, or Run Tasks). In that case, the migration tends to be practically transparent.
  • You want the features that only exist in OpenTofu, such as the native state encryption mentioned above.
  • Open governance is a decision criterion for your organization — teams that value projects under neutral foundations (as is already the case with Kubernetes at the CNCF) tend to prefer OpenTofu’s model.

6. When Migrating Does NOT Make Sense (Yet)

  • Heavy dependence on Terraform Cloud/Enterprise: if your team uses Sentinel, Run Tasks or other deep integrations with HashiCorp’s paid platform, migrating first requires replacing those pieces with equivalents (OpenTofu has partners such as Spacelift, Env0 and Scalr offering this, but it’s an additional migration).
  • Third-party modules or providers with restrictive licensing: rare, but some private modules may have specific clauses about which runtime is allowed.
  • Zero friction right now: if the team is happy with its current Terraform and there’s no licensing, feature or governance motivation, switching tools just for the sake of it introduces operational risk without a clear benefit. IaC is not the place for trend-driven migrations.

7. Migrating Without Drama

Migrating an existing Terraform project to OpenTofu is usually a process of just a few steps, since the state format is compatible:

# Install tofu (example using the official script)
curl -fsSL https://get.opentofu.org/install-opentofu.sh | sh -s -- --install-method standalone

# Inside the existing Terraform project directory
tofu init

# Confirm the plan matches what terraform would generate
tofu plan

In most cases, tofu init recognizes the existing state without requiring any explicit migration — the format is the same. It’s recommended to run tofu plan right after the switch and compare it with the last terraform plan to make sure no unexpected changes show up before running apply.

8. Conclusion

OpenTofu is not a radically different tool from Terraform — and that’s exactly its value proposition. For anyone who already knows Terraform, migrating is a decision with low technical risk and high strategic weight (licensing, governance and a few exclusive features). It’s not a mandatory migration for everyone, but it’s a mature enough alternative to be on the table in any discussion about the future of your IaC stack. In the next article of this series, we leave the territory of “provisioning infrastructure” and enter that of “configuring what has already been provisioned”: Ansible.


References:

  1. OpenTofu — About
  2. OpenTofu Registry