All languages

OpenTofu language

The MPL-licensed fork of Terraform, governed by the Linux Foundation: the same HCL configuration and plan/apply cycle, plus client-side state and plan encryption and its own provider registry.

Overview

OpenTofu is the community fork of Terraform, created after HashiCorp moved Terraform to the Business Source License in August 2023. It keeps the language and the .tf file format, and is described by its maintainers as a drop-in replacement.

Code

locals {
  region    = "eu-west-1"
  instances = 3
  enabled   = true
  prefix    = "env-${local.region}"                        # interpolation
  big       = local.instances > 2 ? "yes" : "no"          # conditional
}
The first three tabs are the language it inherited — literals, collections, for expressions and variable/resource/module — and the fourth is what it added: encryption of state and plan files, plus run/assert tests both forks read.

Distinctive traits

  • Configuration compatibility is the contract: existing .tf files and providers work unchanged, and the migration guide is a rename and a state-file check rather than a rewrite.
  • A reference to another resource's attribute is a dependency edge, and the resulting graph is walked in parallel.
  • State and plan encryption is client-side and configured in the language: a key_provider, a method, and per-artifact state/plan blocks with a fallback for rollover.
  • Keys come from PBKDF2 passphrases, AWS/GCP/Azure KMS, OpenBao, or an external program, so the same mechanism spans self-managed and cloud-held keys.
  • tofu test reads both .tftest.hcl and .tofutest.hcl, so one test suite can target Terraform and OpenTofu.
  • The registry is a git repository of providers and modules, published by pull request — and, being a Linux Foundation project, the manifesto stands in for a vendor's licence promise.

Status

Active: stable releases carry a published 1.x compatibility promise for the language. Distributed as a binary named tofu; source is under the MPL 2.0, with the original Terraform copyright retained.

History

HashiCorp announced the licence change on 10 August 2023. When no response to the community's request to revert arrived by 25 August, the fork was published as OpenTF; it was renamed OpenTofu and adopted by the Linux Foundation before its first stable release. OpenTofu 1.6.0 shipped on 10 January 2024 — a drop-in replacement for Terraform, with the 1.6.0 tag four months after the fork. State encryption, designed in the open through an RFC, followed in 1.7.

Sources & references