OpenTofu 1.12: The Feature Terraform Never Shipped
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
- Community-driven development prioritizes user needs.
- Flexible configuration reduces module duplication.
- Standardized checksums streamline dependency management.
In practice
- Use dynamic `prevent_destroy` in shared modules.
- Stream JSON output to files for tooling.
- Migrate WinRM provisioners to OpenSSH.
Topics
- OpenTofu 1.12
- Infrastructure as Code
- Dynamic `prevent_destroy`
- Shared Modules
- Provider Checksums
- WinRM Deprecation
Code references
Best for: DevOps Engineer, Software Engineer, IT Professional
Related on AIssential
Editorial summary, takeaway, and curation by AIssential. Original article published by InfoQ.