What Is New in Terraform 1.13
Terraform 1.13 introduces the terraform stacks command and several testing improvements that make working with complex configurations and test suites more reliable.
This release focuses on better error handling, performance gains with large resource counts, and enhanced support for writing Terraform tests.
| Category | Key Changes |
|---|---|
| New Features | terraform stacks command for stack operations |
| Enhancements | Filesystem function consistency checks, flexible provider constraint matching during init, performance improvements for high-cardinality resources, parallel teardown in tests, external variable definitions inside test files, improved type mismatch error messages |
| Bug Fixes | Sensitivity handling for nested module outputs, workspace name validation, plan reference truncation, test deadlock prevention, static validation for object indexes, resource identity preservation in state |
| Notes | terraform rpcapi command is now generally available |
Terraform Stacks Command
The new terraform stacks command provides CLI access to stack operations. Available subcommands depend on the installed stacks plugin.
Run terraform stacks -help to see what operations your current setup supports.
This lays groundwork for future stack-based workflows in larger infrastructure projects.
Testing Improvements
You can now define external variables directly inside test files and reference run outputs from other test runs within the same file.
Teardown operations in terraform test can run in parallel, and a parallelism setting of 1 no longer causes deadlocks.
These changes make writing and running test suites for complex modules much more practical.
Performance and Validation Enhancements
Evaluating resources with high cardinality (large count or for_each) is noticeably faster in 1.13.
Filesystem functions are now validated for consistent results during apply to catch invalid data early. Provider constraint matching during init is also more forgiving when at least one valid version exists.
Type mismatch error messages have been improved to help you diagnose configuration issues quicker.
Bug Fixes and Stability
Nested module outputs now correctly preserve sensitivity marking. Empty workspace names are rejected during creation and deletion.
Plan output truncates invalid dynamic references, and resource identity is no longer dropped from state in certain scenarios.
These fixes reduce surprising behavior when refactoring modules or managing workspaces.
FAQ
What is the new terraform stacks command in Terraform 1.13?
It exposes stack operations through the CLI. The available subcommands depend on the stacks plugin you have installed.
How do I define external variables inside a Terraform test file in version 1.13?
You can now add variable definition blocks directly in the test file for any external variables referenced within it.
Did Terraform 1.13 improve performance for resources with large count or for_each?
Yes, evaluation of high-cardinality resources received a performance fix that helps configurations with many instances run faster.
What changed with sensitivity in nested module outputs?
Nested module outputs that were explicitly marked sensitive now correctly retain their sensitivity marking.
Is terraform rpcapi ready for use in Terraform 1.13?
The rpcapi command is now generally available, though it is primarily intended for plugin and tooling developers rather than everyday use.