slide

Comparing open TOFU and terraform

Ned Bellavance
2 min read

Cover

[Last updated 2024-07-30 for Terraform 1.9 and OpenTofu 1.8]

Terraform and OpenTofu are both IaC tools that share a common ancestry. OpenTofu was created when HashiCorp shifted the licensing of Terraform from Mozilla Public License 2.0 to Business Source License 1.1 aka BSL or BUSL.

OpenTofu is a fork on Terraform before the BUSL licensing change, so anything that has been added in Terraform 1.6 or newer will not be in OpenTofu, or at least the code backing any given feature will not be copied over. The OpenTofu maintainers can implement the same functionality using their own original code, but they cannot simply copy the Terraform code even though it is publicly available.

Likewise, any new features added to OpenTofu will not be back-ported into Terraform. While HashiCorp can add feature-parity, the actual code will be different.

Which might leave you wondering, which features are supported in each tool? Are they interchangeable? Can I move from one to the other without rewriting my code? The short answer? If you’re running Terraform 1.5.x or older, you should be able to drop OpenTofu in and run your code without any changes. If you’re running Terraform 1.6 or newer, you will need to check the table below to see if the feature you’re using is supported in OpenTofu. The features included in the table only reflect those that are in official releases and not in alpha or beta builds. I will endeavor to keep this table up to date as new GA features are added to either tool.

FeatureTerraformOpenTofuFeature parity
Testing framework1.61.6Yes
Mock data in testing1.71.8Yes
removed block1.71.7Yes
Updated S3 backend1.61.6As far as I can tell, these appear to be identical
Provider defined functions1.81.7Yes, but the terraform built-in provider functions may not be in OpenTofu
State encryptionNot present1.7No
Provider transfer or object1.8Not presentNo
Input variable validation with other objects1.9Not presentNo
Early variable/locals evaluationNot present1.8No
Support for .tofu filesNot present (of course)1.8No

Those are all the major updates in versions 1.6 and newer. I should note that there maybe minor enhancements and bug fixes that are not included here.

You can always find the latest releases here:

If you think that I have missed something, please let me know via the contact form.