ADR-0015: OpenTofu instead of Terraform#

  • Status: accepted
  • Date: 2026-11-24

Context#

The tech radar held OpenTofu on Assess with "no functional reason to switch". Two things changed that:

infrastructure-as-code tool a person runs once from their own machine. The first draft used CloudFormation, which put a second tool, a second language and a second state model into the repository for one small layer.

  • The owner prefers OpenTofu: open source under MPL 2.0, governed by the Linux

Foundation, with its own provider registry. Terraform is under the BUSL.

The codebase uses nothing OpenTofu lacks: HCL, the S3 backend with native locking, check blocks, mock_provider tests, and the same hashicorp/aws provider.

Decision#

Use OpenTofu for every layer, the seed included, and remove CloudFormation.

  • CLI pinned to ~> 1.13.0 in code and 1.13.2 in CI

(opentofu/setup-opentofu@v2); Renovate tracks the CI pin.

  • Lock files record checksums from registry.opentofu.org for Linux and macOS

on amd64 and arm64. The AWS provider stays on 6.73.0, so the switch changes the tool and nothing else.

  • Files stay .tf in terraform/: the language is still HCL, and renaming the

directory would churn every path for no benefit. Workflow file names (terraform-plan, terraform-apply) stay too, because they are required status check names.

Alternatives considered#

Stay on Terraform, seed in CloudFormation. Worked, but carried two tools for one repository and a seed that read differently from everything else.

Stay on Terraform, seed in Terraform. Same result as this decision minus the licence and governance preference.

Consequences#

Positive: one tool and one language for every layer. An open-source, community-governed toolchain. Access to OpenTofu-only features if they become useful, notably client-side state encryption (on Assess).

Negative: Renovate and some editor tooling assume Terraform first; check that provider bumps still update the registry.opentofu.org lock entries. Mock providers generate random strings for computed attributes, which the AWS provider rejects where an ARN is expected, so two test files give mocked resources well-formed ARNs.

Neutral: terraform-docs, tflint and Trivy read the same HCL and are unchanged.

Revisit when#

  • OpenTofu and the AWS provider diverge in a way that blocks a provider upgrade.
  • A feature this stack needs exists only in Terraform.

Status notes#

  • 2026-11-24. One detail above is out of date without the decision

changing. CI still installs 1.13.2 with opentofu/setup-opentofu, but from one place, .github/actions/setup-tofu/action.yml, with the Action pinned to the commit of v2.0.2 and the download checked against a pinned SHA-256 (roadmap item 2). Renovate still tracks the version; the checksum is changed by hand (conventions).

Built 2026-11-25 from commit 33bfabf6a27d4baeecf228c31bd5d636a3965070. This page was generated from the same source that provisions the infrastructure it describes.