Three months after its previous 1.7 release, OpenTofu, a project that emerged in response to HashiCorpโs licensing changes for Terraform, released its brand-new 1.8 version.
For those unfamiliar, it is a software tool widely adopted in DevOps practices for automating and managing infrastructure as code (IaC). It lets users define and provision data center infrastructure using a high-level declarative configuration language.
This release brought eagerly anticipated enhancements that streamline the infrastructure management process and expand testing capabilities.
Key Features of OpenTofu 1.8
Early Variable/Locals Evaluation: This new feature allows variables and locals to be evaluated early in the configuration process. This is particularly useful for setting backend configurations, module sources, and encryption setups without depending on outputs from resources or data sources.
For example, users can synchronize configurations across different providers, like AWS, using the same variable for multiple settings.
Provider Mocking in Tofu Test: Tofu test now includes the capability to mock entire provider definitions, enabling users to generate mock values for resources and data sources specific to a provider.
This feature is crucial for developers looking to test integrations without the need to engage actual cloud resources, reducing costs and speeding up development cycles.
Resource Overrides in Tofu Test: Building on the mocking capabilities, OpenTofu 1.8 allows for overriding resources, data sources, and even entire modules within test configurations. This enhancement mimics traditional software testing methodologies where elements can be isolated and tested under controlled conditions.
Override Files for OpenTofu: The update introduces override files to maintain compatibility with Terraform while leveraging new features exclusive to OpenTofu. Developers can now use “.tofu” files that OpenTofu prioritizes over standard “.tf” files, allowing for seamless compatibility and easier maintenance.
Improvements and Deprecations
With OpenTofu 1.8, the use_legacy_workflow
option has been deprecated from the S3 backend. Moreover, the new version includes numerous smaller improvements and bug fixes alongside major features.
More specifically, the update enhances performance with options like configurable state persistence intervals and compact JSON encoding for state files. It also addresses issues like encryption configuration validation and improves backend stability.
For more detailed information on all changes, visit the changelog or check out the list of the new OpenTofu 1.8 features here.