OpenTofu, an open-source infrastructure-as-code tool for defining, provisioning, and managing cloud and on-prem resources declaratively, maintained as a community-driven fork of Terraform, has released version 1.12 with several workflow enhancements.
The primary update allows the prevent_destroy lifecycle argument, which blocks accidental deletion of managed resources, to be set dynamically. Previously, this setting required hard-coding. OpenTofu 1.12 now enables referencing values from within the same module, such as input variables. Acording to devs, this is the first of several lifecycle settings they plan to make more dynamic in future releases.
Provider checksum handling has also been improved in this release. The tofu init command now automatically records complete checksums for all platforms using both zh: and h1: hashes, which reduces the need to run tofu providers lock manually in environments with shared plugin caches or local provider mirrors.
Moreover, OpenTofu 1.12 introduces the -json-into=FILENAME option, which enables commands to write machine-readable JSON output to a separate file while maintaining standard human-readable output in the terminal. This benefits tools that require JSON output without replacing the CLI interface.
Another lifecycle update is the destroy = false option for managed resources, which allows objects to be removed from OpenTofu’s state without first destroying the remote object.
Additionally, provider installation is now faster in some configurations, as OpenTofu performs concurrent requests during installation. This reduces the time required for tofu init when configurations depend on multiple providers.
This release also includes two deprecation notices. WinRM support for provisioners is now deprecated due to unmaintained Go libraries. OpenTofu 1.12 will display warnings for configurations using connection blocks with type = "winrm"; however, the feature will continue to function for now. The project plans to remove WinRM support in the OpenTofu 1.13 series.
At the same time, OpenTofu is preparing to phase out official builds for 32-bit CPU architectures, specifically 386 and ARM. While OpenTofu 1.12 does not change CPU support, future 1.13 builds will begin displaying warnings on 32-bit systems before support is removed in a later release. Support for amd64 and arm64 remains unchanged.
For more details, see the announcement.
OpenTofu 1.12 is now available on the project’s GitHub releases page, through supported package managers, and as official Docker images.
