Skip to main content
DevOps 1 min read 480 views

Terraform Adds Test Infrastructure Persistence and Query Commands

HashiCorp's Terraform now supports persistent test infrastructure through backend blocks in run blocks and introduces a new query command for infrastructure inspection.

TD

TechDrop Editorial

Share:

Recent Terraform updates introduce significant enhancements to testing capabilities, allowing developers to maintain long-running test infrastructure between operations and query existing infrastructure more effectively.

Test Infrastructure Persistence

Test authors can now keep test infrastructure alive between test operations using the skip_cleanup attribute within test files and run blocks. When set to true, Terraform writes state files to disk within the .terraform directory instead of destroying resources after test completion. These state files can be manually cleaned up using the experimental terraform test cleanup command. Additionally, run blocks now support backend blocks, enabling tests to load state from specified backends rather than starting from empty state on each execution.

New Query Command

The terraform query command provides a new way to execute list operations against existing infrastructure and display results. The command can optionally generate configuration for importing query results into Terraform management, simplifying the process of bringing existing infrastructure under Terraform control. These features enhance Terraform's testing framework, making it more practical for complex infrastructure scenarios that require validation across multiple test runs.

Related Articles

DevOps 2 min read

Docker Engine 29.3 Ships with Native gRPC Support and BuildKit v0.28

Docker Engine 29.3.0 introduces native gRPC support on listening sockets, BuildKit v0.28.0, and a new bind-create-src option for flexible volume mounting. The release lowers the minimum API version to v1.40 for broader backward compatibility and fixes DNS configuration corruption during daemon reloads.