OpenTofu Cheat Sheet
The open-source fork of Terraform — same plan/apply workflow with an open governance model.
Infrastructure as Code3 sections · 15 commands
⌘K
Migrating from Terraform
5alias tofu=terraform # symbolicDrop-in alias for most commands
tofu init -migrate-stateMigrate remote state to the fork
tofu init -upgradeRefresh providers and modules
tofu providersProviders in the config
tofu versionCheck the fork version
Lifecycle
6tofu initInit modules and providers
tofu planPreview the changes
tofu applyApply the plan
tofu destroyRemove managed resources
tofu output -jsonMachine-readable outputs
tofu consoleInteractive expression evaluation
Config & State Files
4main.tf / variables.tf / outputs.tfConventional file layout
*.tfstate / *.tfstate.backupState and backup files (never commit)
.terraform/Local provider cache (gitignore)
.terraform.lock.hclProvider version checksums