In the world of infrastructure as code (IaC), Terraform has been a stalwart companion for nearly a decade. However, recent changes in its licensing have left many in the community seeking alternatives. Enter OpenToFu – a fork of Terraform that emerged as a result of community-driven development.
OpenToFu aims to be backward compatible with Terraform, making the transition for existing users smooth. The familiar syntax, provider ecosystem, and module structure are all present, ensuring that your existing infrastructure code works as expected.
You’ll be pleased to know that the existing Brightbox terraform driver works flawlessly with the OpenToFu fork, giving Brightbox users the choice as to which tool to use.
OpenToFu is straightforward to install in various ways, and they provide a convenient install script that takes care of the process for you:
# Download the installer script:
curl --proto '=https' --tlsv1.2 -fsSL https://get.opentofu.org/install-opentofu.sh -o install-opentofu.sh
# Give it execution permissions:
chmod +x install-opentofu.sh
# Please inspect the downloaded script
# Run the installer:
./install-opentofu.sh --install-method deb
As with Terraform, OpenToFu needs to install its support modules before it can run a plan. The command is very familiar:
$ tofu init
Initializing the backend...
Initializing provider plugins...
- Finding brightbox/brightbox versions matching "~> 3.0"...
- Installing brightbox/brightbox v3.4.3...
- Installed brightbox/brightbox v3.4.3 (signed, key ID 86A01C78D276AC7C)
Providers are signed by their developers.
If you'd like to know more about provider signing, you can read about it here:
OpenTofu has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that OpenTofu can guarantee to make the same selections by default when
you run "tofu init" in the future.
OpenTofu has been successfully initialized!
You may now begin working with OpenTofu. Try running "tofu plan" to see
any changes that are required for your infrastructure. All OpenTofu commands
should now work.
If you ever set or change modules or backend configuration for OpenTofu,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
And that’s it. Swap
tofu and you’re good to go. If
you need any further information the OpenTofu website has a good