In infrastructure as code (IaC), Terraform and OpenTofu have arisen as frontrunners, enabling developers and operations teams to manage cloud infrastructure competently. While both tools share the mutual goal of simplifying infrastructure provisioning and management, they vary in their licensing, community support, and future development direction, leading to distinctive advantages and disadvantages.
In this article we’ll dig into a comparative analysis of OpenTofu and Terraform. We’ll also discuss the influence of the license change on future development exploring their features, benefits, and drawbacks from the perspectives of developers, operations teams, and management. We hope this can help you make an informed decision when choosing the right tool for your orchestration needs. Let’s start.
Also Read: An Ultimate Guide to Become a HashiCorp Certified: Terraform Associate
What is Terraform?
Terraform, an industry-leading infrastructure as code (IaC) tool, has been a keystone of cloud provisioning and infrastructure management since its inception in 2014. Over the years, it has raised a vibrant community comprising thousands of users, contributors, vendors and an extensive ecosystem of open source modules and extensions.
What is OpenTofu?
OpenTofu is a fully open-source Terraform fork, a drop-in auxiliary for Terraform version 1.6 that is backward compatible with all prior versions of Terraform. It’s a viable substitute to HashiCorp’s Terraform that will expand on Terraform’s existing concepts and offerings.
OpenTofu is an open-source Infrastructure as Code (IaC) tool that enables you to define, preview, and apply infrastructure changes across multiple cloud providers. It uses declarative OpenTofu language to manage infrastructure resources.
Why was OpenTofu Created?
It was created by the initiative of OpenTF supported by Gruntwork, Spacelift, Harness, Env0, Scalr, and other companies as a reaction to HashiCorp’s license changes to the BSL . On August 15th, OpenTF released its manifesto. The manifesto lays out OpenTFs intent and goals and sets out a roadmap to certify the continued survival of Terraform as an open-source tool.
The OpenTofu initiative was launched with substantial initial support, boasting over 18 full-time equivalents (FTEs) committed to the project from four companies. The manifesto is endorsed by over 140 companies, involving 11 projects with the participation of over 700 individuals. Furthermore, the manifesto has received more than 35,000 GitHub stars, and the fork itself has garnered over 6,000 stars in just one week.
On September 5th, OpenTofu officially published the fork, and on September 20th, the project officially joined the Linux Foundation with the eventual goal of joining the Cloud Native Computing Foundation (CNCF).
Recently, OpenTofu has released its 1.7 version. The latest OpenTofu version comes packed with new features, enhancements, and bug fixes that target to elevate the user experience, improve overall functionality, and boost your infrastructure as code management.
The new licensing terms for Terraform, especially the Business Source License (BSL) and HashiCorp’s additional use grant, make it difficult for companies, vendors, and developers using Terraform to know whether what they are doing is allowed or not under the license.
Moreover, Hashicorp’s FAQs offer some reassurance to end users and system integrators for now, but questions arise over the implications of the licensing terms for future usage. The potential for changes to the company’s definition of “competitive” or “embedding” or further alterations to the license to make it a closed source creates uncertainty for Terraform users.
Critics strongly believe that Terraform should stay open-source, as it is a project used by many companies, and many people have contributed to getting Terraform where it is today. Terraform wouldn’t be as successful as it is without the community’s effort in building many supporting projects around it.
Terraform vs. OpenTofu: Similarities
As OpenTofu is a fork of Terraform 1.6.x so there are many similiarities for now. They both have the capability to create, deploy, and manage infrastructure as code on any cloud. Both Terraform and OpenTofu follow a desired state infrastructure as code model, where the IaC code represents the preferred state of the infrastructure. The deployment engine compares this desired state with the current state of the stack and determines the compulsory actions, such as creating, updating, or deleting resources. Both Terraform and OpenTofu support many cloud providers, including AWS, Azure, and Google Cloud, plus other services like CloudFlare, Digital Ocean. They also both require the use of a domain-specific language: HashiCorp Configuration Language (HCL).
Terraform vs. OpenTofu: Key Differences
Terraform and OpenTofu differ in that Terraform is not open source, using the Business Source License model. OpenTofu, though, uses the weak copyleft Mozilla Public License 2.0. Terraform also has a paid offering called Terraform Cloud, a fully managed SaaS service that version controls and manages Terraform state. Terraform Cloud also provides access to remote operations, policy as code, and audit logging. OpenTofu is supported by env0 and Spacelift SaaS services for managing Terraform state.
As Terraform and OpenTofu continue to diverge, more key differences will arise. Let’s dive deep into more comparative analysis from features to complexity.
A Comparative Analysis: OpenTofu vs Terraform
Features
In terms of functionality, both tools are currently same. The OpenTofu community has intended to maintain feature parity with Terraform for the time being. As such, both currently offer the same large set of features making them well suited tools for IaC workloads.
Some small features were added with the release of OpenTofu 1.6.0 however, including:
- An innovative testing feature for improved stability in configurations and modules
- Enhanced S3 state backend with new authentication methods
- A new provider and module registry, allowing a simpler method of publishing through pull request
The upcoming version 1.7 targets to introduce more community requested features not available in Terraform, including:
- Client-side state encryption for heightened security in regulated environments
- Parameterizable backends, providers, and modules to facilitate more readable, DRY code
- Third-party extensibility, with a plugin system for new state backends
On Terraform’s side, version 1.6 implemented performance improvements to the ‘terraform test’ command, as well as changes to the S3 backend.
These changes indicates the end of feature parity between both tools. As for compatibility, as both tools evolve separately, it remains to be seen whether the OpenTofu community will stay committed to incorporating Terraform’s development in its own tool.
Configuration and Syntax
OpenTofu and Terraform both use Hashicorp Configuration Language (HCL) to define their resources. HCL is declarative, describing an envisioned goal rather than the steps to reach that goal.
In terms of configuration options, both are also similar.
Licensing
Both Terraform and OpenTofu are open-source tools, providing free usage.
As discussed above, OpenTofu uses the Mozilla Public License (MPL 2.0), which allows developers to freely use, change, and distribute software for both commercial and non-commercial use.
Terraform has now shifted to the Business Source License (BUSL 1.1). This also certifies free use of source code, including commercial use, except when it’s used to provide an offering that competes with HashiCorp. An example of this could be running Terraform in a hosted way in CI/CD and offering this as a production service.
Hence, Terraform remains free to use in your projects, there can be an issue when incorporating Terraform in a service offering.
Pricing and Offerings
In terms of pricing, both tools are free to use, with some limitations for commercial use when it comes to Terraform.
Hashicorp offers paid solutions, starting with Terraform Cloud, a centralized platform for managing Terraform code. Noteworthy features include version control integration, secure variable storage, remote state management, and policy enforcement, enabling organizations to efficiently maintain control over their cloud infrastructure.
Pricing for Terraform Cloud follows a Resources under Management (RUM) model, where Terraform counts the amount of objects it manages and calculates cost accordingly. The Standard Tier offering is billed at $0.00014 per hour per resource. For the Plus and Enterprise tiers, pricing is negotiated directly with Hashicorp sales.
Let’s take the example for Terraform Enterprise. This is a self-hosted solution offered as a private installation rather than a SaaS solution. Judging from the AWS Marketplace and Azure Marketplace offerings of Terraform Enterprise, pricing starts from $15,000/year. This includes just five workspaces, likely to be inadequate for a large enterprise.
Community and Support
Terraform presently holds the advantage when it comes to community support. Backed by Hashicorp and benefiting from years of community-wide support as an open-source project pre-license change. It offers a large extent of resources for user to take advantage of. The impact of the license changes is starting to show however, with community contributions to Terraform drying up almost completely in the last couple of months. Time will tell what the final effect of this shift in community support will mean for users.
OpenTofu, on the other hand, is a growing tool with an expanding community. Though not as large as Terraform’s, its community is rapidly expanding as more users move to OpenTofu. It is backed by the Linux Foundation as well as companies such as Gruntwork, env0, Scalr and our very own Sopra Steria AS. This rising support will provide ever increasing resources for users of the tool in the future.
Maturity and Stability
Terraform is proven as a mature, stable and extremely popular orchestration tool capable of handling enterprise-grade infrastructure deployments. OpenTofu is a new tool. Conversely, as a fork of Terraform, it stems from the same code base and thus is expected to perform similarly in terms of stability
After a detailed preview below is a summary of the key differences between Terraform and OpenTofu:
Feature | Terraform | OpenTofu |
OSS License | No, Business Source License 1.1 | Yes, Mozilla Public License 2.0 |
Language Support | HashiCorp Configuration Language (HCL) | HashiCorp Configuration Language (HCL) |
IDE Support | Limited | Limited |
State Management | Self-managed by default, managed SaaS offering available. | Self-managed by default, managed SaaS offerings available. |
Provider Support | Support across multiple IaaS, SaaS, and PaaS providers. | Support across multiple IaaS, SaaS, and PaaS providers. |
Cloud Native Support | Core API typed. Generic support for CRD. | Core API typed. Generic support for CRD. |
Dynamic Provider Support | No | No |
Infrastructure Reuse and Modularity | Constrained. Can only reuse Terraform modules. | Constrained. Can only reuse OpenTofu modules. |
Testing and Validation | Integration testing only. | Integration testing only. |
Modes of Execution | Run CLI commands or perform remote runs with SaaS offering. | Run CLI commands only. |
Embed within Application Code | No | No |
Third-party CI/CD Tools Support | Yes | No |
Policy as Code | Yes | No |
Secrets Management | No. Secrets are stored in a separate product (Vault). There is no way to encrypt them in the state file. | No. Secrets can be stored in a 3rd party product. There is no way to encrypt them in the state file. |
Audit Capabilities | Limited | No |
Adopt Existing Resources | Yes. No code generation capabilities. | Yes. No code generation capabilities. |
Aliases | Limited | Limited |
Transformations | No | No |
Import Code from other IaC Tools | No | No |
Terraform vs OpenTofu: Which One Should You Choose?
The choice between “OpenTofu vs Terraform” ultimately depends on your particular needs and preferences. “Terraform,” with its mature toolset, huge community, and extensive features, excels for enterprise-scale projects and complex infrastructure deployments. On the other hand, “OpenTofu,” an open-source, community-driven substitute with a user-friendly interface, is an excellent choice for those prioritizing licensing flexibility and simplicity in infrastructure definition.
Developers may favor Terraform’s established syntax and extensive tooling, while OpenTofu’s drop-in replacement nature and growing community offer a promising alternative. Operations teams can rely on both Terraform’s proven reliability and performance and OpenTofu’s stability and integration capabilities. Management teams will need to contemplate the cost implications of Terraform’s licensing compared to OpenTofu’s open-source nature, as well as the potential for vendor lock-in with Terraform versus the flexibility offered by OpenTofu. Eventually, the decision between Terraform vs OpenTofu requires careful consideration of your unique project requirements and your preferred approach to Infrastructure as Code in the context, financial constraints, and strategic goals.
Conclusion
Regardless of the emergence of OpenTofu, Terraform remains a stalwart in the IaC realm, with a massive user community ensuring its relevance. HashiCorp’s reputation however, has taken a hit with the sudden shift in its licensing policy and it remains to be seen how this strategic shift will affect users long-term.
For OpenTofu, at least for now, the future looks bright. The community’s rapid growth, the Linux Foundation’s stewardship, and the release of version 1.6.0 are indications of the community’s commitment to keeping orchestration truly open-source. New features like advanced testing, enhanced S3 state backend and the prospect of a host of other community-requested features being added express that OpenTofu is capable of delivering on its promise and evolve according to its user’s needs.
When you are a service provider looking to incorporate Terraform in one of your offerings, it can be worthy to look at OpenTofu as a truly open-source alternative to avoid licensing costs or legal trouble.
For regular users, not much has changed on the surface. Terraform still is a very robust and well supported too capable of handling your orchestration needs. OpenTofu does offer some benefits in ease of use and configuration, and as both tools are currently compatible and functionally equivalent it may be exciting to take try out OpenTofu and see what it has to offer.
FAQS
Will OpenTofu be Compatible with Future Terraform releases?
The open-source community supporting OpenTofu will decide the future of the project. While the early signs are positive, it remains to be seen whether the tool can keep up in functionality and compatibility with Terraform, or even surpass it in some areas. Some long-awaited Terraform features will be publicly available soon.
What are the Differences Between OpenTofu and Terraform?
On the technical level, OpenTofu 1.6.x is very similar feature-wise to Terraform 1.6.x. In the future, the projects feature sets will diverge.
The other main difference is that OpenTofu is open-source, and its aim is to be driven in a collaborative way with no single company being able to dictate the roadmap.
What is OpenTofu?
OpenTofu is a Terraform fork, generated as an initiative of Gruntwork, Spacelift, Harness, Env0, Scalr, and others, in response to HashiCorp’s switch from an open-source license to the BUSL
What is Replacing Terraform?
Replacements to Terraform cater to a variety of infrastructure-as-code needs. Your options from competitors include OpenTofu, Pulumi, AWS CloudFormation, Ansible, Crossplane, and others.