What's new in Terraform v1.5.0

Terraform is an open-source infrastructure as code (IaC) tool that enables users to define and provision infrastructure resources across various cloud providers. With a declarative configuration language, Terraform allows users to describe their desired infrastructure state and automatically manages resource creation, modification, and destruction.

Supporting multiple cloud platforms, it provides a unified workflow for consistent provisioning. By enforcing infrastructure as code principles, Terraform promotes collaboration, versioning, and reproducibility. It integrates with other tools, offers dependency and remote state management, and simplifies infrastructure automation, making it a powerful solution for efficient infrastructure provisioning and management.

In the next sections, let's deep dive in two majors changes released.

Check blocks

Used for validating infrastructure purposes, module and configuration authors can now write independent check blocks within their configuration to validate assertions about their infrastructure.

The new independent check blocks must specify at least one assert block, but possibly many, each one with a condition expression and an error_message expression matching the existing Custom Condition Checks.
Additionally, check blocks can optionally load a scoped data source. Scoped data sources match the existing data sources with the exception that they can only be referenced from within their check block.

Unlike the existing precondition and postcondition blocks, Terraform will not halt execution should the scoped data block fail or error or if any of the assertions fail.
This allows practitioners to continually validate the state of their infrastructure outside the usual lifecycle management cycle.

Import blocks

Root module authors can now use the import block to declare their intent that Terraform adopt an existing resource.

Import is now a configuration-driven, plannable action, and is processed as part of a normal plan. Running terraform plan will show a summary of the resources that Terraform has planned to import, along with any other plan changes.

The existing terraform import CLI command has not been modified.

This is an early version of the import block feature, for which we are actively seeking user feedback to shape future development. The import block currently does not support interpolation in the id field, which must be a string.

Lenstra helps companies leverage Computer Science to enhance their Economic Performance

Contact us for a free consultancy to explore how we can work together.

Contact us

Release v1.5.0 · hashicorp/terraform
1.5.0 (June 12, 2023) NEW FEATURES: check blocks for validating infrastructure: Module and configuration authors can now write independent check blocks within their configuration to validate asse…

Read more