The open-source, community-governed fork of Terraform - same HCL, MPL-licensed. This walkthrough covers the mental model and the configuration you will actually touch.
OpenTofu is a drop-in, MPL-2.0 licensed fork of Terraform under the Linux Foundation. It speaks the same HCL and provider ecosystem, with community governance and features like state encryption.
The configuration that matters
Identical HCL to Terraform - just run with tofu.
terraform {
required_providers { aws = { source = "hashicorp/aws" } }
encryption { # OpenTofu native state encryption
key_provider "pbkdf2" "k" { passphrase = var.state_pass }
method "aes_gcm" "m" { keys = key_provider.pbkdf2.k }
state { method = method.aes_gcm.m }
}
}Principles to hold onto
- Standardize on one binary per project
- Use native state encryption for sensitive state
- Pin provider versions and commit the lock file
Everyday commands
tofu init
tofu plan -out tfplan
tofu apply tfplanWant senior help putting OpenTofu to work - or a team bootcamp on it? CodeWizard runs Israel's largest DevOps community and embeds named senior engineers with a transparent hours log. Book a free consult or explore the Academy.