The latest update to the OpenTofu infrastructure-as-code (IaC) tool is making it simpler to update and refactor configurations without having to rework the entire codebase.
Version 1.12.0 of OpenTofu has added a destroy = false lifecycle option that enables DevOps engineers to drop an object from state without issuing a destroy application programming interface (API) call.
Previously, any time a resource was updated or added an API call would try to destroy the actual infrastructure behind it. While DevOps teams could work around that issue by carefully maintaining state, the chances that something could go awry were fairly high.
Now OpenTofu 1.12.0 allows DevOps teams to tie prevent_destroy to an input variable within the same module. Once set to default, the API call to destroy the IT infrastructure environment is overwritten. That per-stack variable configuration means DevOps teams can define the safety behavior once per environment and have it stay consistent across every run.
Version 1.12.0 of OpenTofu also makes it simpler to fetch configurations in parallel to reduce the amount of time required multiple times a day to perform that task.
Finally, a -json-into=FILENAME has been added that writes a structured JSON stream to a separate file, while the terminal continues to show standard human-friendly output. That capability promises to make it simpler to build a progress tracker or a notification system without giving up the terminal experience or having to run the command twice.
Jonah Kowall, senior vice president of product for Spacelift, a provider of an IaC orchestration platform that contributes code to the OpenTofu project, said OpenTofu 1.12.0, in general, now makes upgrading or adding resources to configurations a much more routine type of task.
Currently being advanced under the auspices of the Cloud Native Computing Foundation (CNCF), OpenTofu has been gaining traction as an alternative to the open source Terraform project managed by the HashiCorp arm of IBM. In fact, Spacelift reports that more than 50% of all runs on its platform are driven by OpenTofu.
Going forward, the maintainers of the project are also looking at revamping the underlying engine the project relies on to make the overall platform more efficient, said Kowall. The current engines are based on a fork of the Terraform project that was initially used to create OpenTofu when HashiCorp changed its licensing terms.
As OpenTofu continues to evolve, the maintainers of the project are betting that as they address longstanding Terraform issues, the number of organizations willing to switch IaC tools will continue to increase, said Kowall. As has been shown in the past, multiple teams and organizations contributing to an open source project creates a flywheel of innovation that no single IT vendor can match, he added.
The only issue many organizations making that decision will need to contend with, of course, is finding a way to manage IT environments made up of a mix of OpenTofu and Terraform code that might, in one form or another, be around for many years to come.

