What OpenTofu Is (and How It Relates to Terraform)

OpenTofu is the tool this repo uses to turn .tf files into real AWS resources. A few facts that matter:

  • It is a fork of Terraform. Terraform is the original, widely used IaC tool made by HashiCorp. In 2023 HashiCorp changed Terraform's license; the community responded by forking the last open-source version into OpenTofu, which stays fully open source. OpenTofu is a drop-in replacement that uses the same language and the same providers.
  • The language is the same. Both use HCL (HashiCorp Configuration Language) - the syntax you see in every .tf file. Learning OpenTofu is learning Terraform's language.
  • The CLI is tofu, not terraform. Where a Terraform tutorial says terraform plan, here you run tofu plan. This repo's README is explicit: "Infrastructure is defined with OpenTofu … the CLI is tofu, not Terraform."

How OpenTofu actually talks to AWS: it uses a provider. A provider is a plugin that knows how to call a specific platform's API. This repo uses the hashicorp/aws provider (and a small hashicorp/random provider). When you write resource "aws_s3_bucket" "x" { ... }, the AWS provider translates that into the right AWS API calls.

Providers are declared in versions.tf files. For example bootstrap/versions.tf:

HCL
terraform {
  required_version = ">= 1.10.0"     # minimum OpenTofu version

  required_providers {
    aws = {
      source  = "hashicorp/aws"      # which provider
      version = "~> 5.70"            # which version range (see section 14)
    }
  }
}

Note: the configuration block is still spelled terraform { ... } even in OpenTofu - that name was kept for compatibility. Don't let it confuse you; this is an OpenTofu project.

The exact tool versions this project pins live in .tool-versions: opentofu 1.12.1 and tflint 0.59.1.

Adesh Tamrakar
SOFTWARE ENGINEER · VAULT

Notes, insights and random discoveries from a working engineer's vault - written for future me, published for you.