OpenTofu 1.12: The Feature Terraform Never Shipped

· Source: InfoQ · Field: Technology & Digital — Cloud Computing & IT Infrastructure, Software Development & Engineering · Depth: Intermediate, short

Summary

OpenTofu 1.12.0, released on May 14, 2026, introduces several key features addressing long-standing infrastructure management challenges. The most significant is dynamic `prevent_destroy`, which allows resource protection from accidental deletion to be controlled by variables, enabling shared module use across diverse environments like development and production without code duplication. This feature resolves an issue first requested in Terraform 0.7 in 2016. The update also improves OperProvider checksum handling, with the OpenTofu Registry now providing both `zh:` and `h1:` hashes during `tofu init` for streamlined dependency lock file management. A new `-json-into=FILENAME` flag facilitates building tooling by allowing JSON output to a file while preserving terminal output. Additionally, a `destroy = false` meta-argument simplifies removing resources from state without actual destruction. WinRM provisioner support and 32-bit architecture builds are being deprecated, with removal planned for 1.13.

Key takeaway

For DevOps Engineers managing infrastructure with shared modules across environments, OpenTofu 1.12's dynamic `prevent_destroy` feature eliminates the need for module duplication, simplifying lifecycle management. You should evaluate upgrading to leverage this and the improved `tofu init` checksum handling, which streamlines provider dependency management. Additionally, if you build custom tooling, the new `-json-into=FILENAME` flag offers cleaner integration by separating machine-readable output from terminal logs. Plan to migrate any WinRM provisioners to OpenSSH before 1.13.

Key insights

OpenTofu 1.12 delivers long-requested features like dynamic `prevent_destroy`, showcasing community-driven development's responsiveness to user needs.

Principles

In practice

Topics

Code references

Best for: DevOps Engineer, Software Engineer, IT Professional

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by InfoQ.