slide

Comparing open TOFU and terraform

Ned Bellavance
2 min read

Cover

[Last updated 2024-01-26]

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 frameworkIntroduced in 1.6Introduced in 1.6The overall implementation of the testing framework appears to be the same, but the introduction of mock data in Terraform 1.7 is not present in OpenTofu.
Mock dataIntroduced in 1.7Not presentNo
removed blockIntroduced in 1.7Not presentNo
Updated S3 backendIntroduced in 1.6Introduced in 1.6As far as I can tell, these appear to be identical

Those are all the major updates in version 1.6 and 1.7. I should note that there maybe minor enhancements and bug fixes that are not included here. If you think that I have missed something, please let me know via the contact form. I’m also thinking of creating a GitHub repository for this instead. We’ll see.