Latest in branch 1.9
1.9.8
Released 16 Oct 2024
(1 year ago)
SoftwareTerraform
Version1.9
Status
End of life
Initial release1.9.0
26 Jun 2024
(1 year ago)
Latest release1.9.8
16 Oct 2024
(1 year ago)
End of security fixes27 Feb 2025
(Ended 1 year, 3 months ago)
Release noteshttps://github.com/hashicorp/terraform/blob/v1.9/CHANGELOG.md
Source codehttps://github.com/hashicorp/terraform/tree/v1.9
Documentationhttps://developer.hashicorp.com/terraform/docs
Downloadhttps://releases.hashicorp.com/terraform/
Terraform 1.9 ReleasesView full list

What Is New in Terraform 1.9

Terraform 1.9 focuses on refining the testing experience and enhancing provider workflows. The headline feature is the general availability of the terraform test command, moving it out of beta with several key improvements.

Category Key Changes
New Features General availability of terraform test, Provider-defined functions
Enhancements Test file filtering, Mock providers, Plan output in tests
Bug Fixes Various fixes for the terraform test command and core
Deprecations Removal of previously deprecated features

What makes the terraform test command production-ready?

The terraform test command has graduated from beta to general availability. This means the command line interface and core functionality are now stable for production use.

You can now write and execute tests in .tftest.hcl files to validate your modules and configurations. The command integrates directly into Terraform's execution workflow, making it a native part of your infrastructure testing strategy.

How can I run specific tests instead of all of them?

Test file filtering allows you to target specific test files during execution. Use the -filter flag with the terraform test command to run only the tests you need.

This is a huge time-saver during development. Instead of running your entire test suite every time, you can focus on the specific .tftest.hcl file you're currently working on.

What are provider-defined functions and why do they matter?

Provider-defined functions enable providers to expose custom functionality directly to Terraform configurations. Providers can now implement and register their own functions alongside built-in ones like lower() or merge().

This opens up powerful possibilities for provider-specific data manipulation and validation. In practice, this means providers can offer domain-specific functions that understand their resources and data sources better than generic Terraform functions could.

Can I test Terraform configurations without real cloud API calls?

Yes, mock providers now let you test Terraform configurations without making actual API calls to cloud platforms. This is implemented through the new testing framework's ability to use mock providers.

You can simulate provider behavior for testing scenarios where you want to verify plan outcomes without creating real infrastructure. This makes tests faster, more reliable, and free from cloud provider dependencies or costs.

What's better about test output and debugging in this release?

The test execution output now includes the plan output for each run block, giving you complete visibility into what changes Terraform would make. This enhancement makes debugging test failures significantly easier.

When a test assertion fails, you can see exactly what the plan looked like at that point in the test. This immediate feedback loop helps you understand why a condition wasn't met without additional debugging steps.

FAQ

Is the terraform test command backward compatible with my existing tests?
Yes, tests written for the beta version should continue to work without changes. The GA release stabilizes the interface without breaking existing functionality.

Can I use provider-defined functions with any Terraform provider?
Only providers that have been updated to implement and expose these functions will support them. Check your provider's documentation for specific function availability.

How do mock providers differ from the existing mock_provider feature?
Mock providers in the test framework are specifically designed for the terraform test command and integrate directly with the testing workflow, providing more control over simulated responses.

Does test file filtering work with directory structures?
Yes, you can use the -filter flag with relative paths to target test files in subdirectories, making it easy to organize tests by component or environment.

Are there any performance improvements in test execution?
While not explicitly called out as a performance release, the addition of test filtering and mock providers significantly reduces test execution time by avoiding unnecessary tests and real API calls.

Releases In Branch 1.9

VersionRelease date
1.9.816 Oct 2024
(1 year ago)
1.9.702 Oct 2024
(1 year ago)
1.9.618 Sep 2024
(1 year ago)
1.9.520 Aug 2024
(1 year ago)
1.9.407 Aug 2024
(1 year ago)
1.9.324 Jul 2024
(1 year ago)
1.9.210 Jul 2024
(1 year ago)
1.9.103 Jul 2024
(1 year ago)
1.9.026 Jun 2024
(1 year ago)
1.9.0-rc321 Jun 2024
(1 year ago)
1.9.0-rc219 Jun 2024
(1 year ago)
1.9.0-rc112 Jun 2024
(1 year ago)
1.9.0-beta131 May 2024
(2 years ago)
1.9.0-alpha2024051616 May 2024
(2 years ago)
1.9.0-alpha2024050102 May 2024
(2 years ago)
1.9.0-alpha2024040404 Apr 2024
(2 years ago)