1.8.5

Latest release in branch 1.8
Released 1 year ago (June 05, 2024)

Software Terraform
Branch 1.8
Status
End of life
End of security fixes November 26, 2024
First official release version 1.8.0
First official release date 2 years ago (April 10, 2024)
Release notes https://github.com/hashicorp/terraform/blob/v1.8/CHANGELOG.md
Source code https://github.com/hashicorp/terraform/tree/v1.8
Documentation https://developer.hashicorp.com/terraform/docs
Download https://releases.hashicorp.com/terraform/
Terraform 1.8 Releases View full list

What Is New in Terraform 1.8

This release introduces significant enhancements for testing and managing provider dependencies, alongside a host of other improvements and bug fixes.

Category Key Changes
New Features Provider-defined tests, Optional provider attributes, terraform test command enhancements
Enhancements Improved terraform init output, Config-driven remove, State encryption
Bug Fixes Numerous fixes across core, backends, and the cloud block
Deprecations Deprecated terraform graph command

How does testing work with providers now?

Terraform 1.8 introduces provider-defined tests, a major shift that allows provider developers to create and ship custom tests directly within their providers. This means you can run tests for specific cloud resources using the familiar terraform test command, integrating provider-specific validation logic directly into your testing workflow.

In practice, this allows for more granular and accurate testing of resources. Instead of just checking if a resource was created, a provider can now test its actual behavior and state in the cloud platform, catching issues that generic Terraform tests might miss.

What's new with provider dependencies?

Optional provider attributes let you mark certain provider dependencies as non-essential. This is useful for modules that can work with multiple providers or when a provider is only needed for specific, advanced features.

You define this in your module's required_providers block by setting optional = true. This change makes module composition more flexible and prevents errors when an optional provider isn't configured in the root module.

What improvements were made to the testing command?

The terraform test command now includes a -verbose flag to output more detailed information during test execution. This is a simple but crucial addition for debugging complex test failures, giving you better visibility into what each test is actually doing step-by-step.

Additionally, the command now properly handles interrupt signals (Ctrl+C), allowing you to cleanly stop test execution instead of having to wait for the entire test run to complete or force-terminate the process.

Are there any changes to the init process?

Yes, terraform init now provides clearer output when installing providers. The command displays more informative messages about what it's doing during provider installation, making it easier to understand the initialization process and troubleshoot when things go wrong.

This might seem minor, but in complex setups with many providers, the improved feedback helps you quickly identify which provider is causing an issue during initialization.

What about state management improvements?

Config-driven remove is now generally available, allowing you to plan and review the destruction of resources managed by terraform state rm before executing it. This brings the same safety and predictability to resource removal that you get with terraform apply.

State encryption has also been enhanced with support for AES-GCM and AES-GCM-SIV encryption modes, providing more robust options for securing your state files at rest.

FAQ

Can I use provider-defined tests with any Terraform provider?
No, only providers that have been updated to implement the new testing functionality will work with provider-defined tests. You'll need to check with your provider's documentation to see if they support this feature.

What happens if I use a module with optional providers but don't configure them?
Terraform will simply ignore the optional providers that aren't configured. The module should be designed to handle this scenario gracefully, either by skipping functionality that requires the missing provider or providing reasonable defaults.

Is the terraform graph command being removed?
Not immediately. The command has been deprecated in this release, which means it's still available but will likely be removed in a future version. You should start exploring alternatives for visualizing your Terraform configurations.

Do I need to change my state encryption configuration?
No, existing encryption configurations will continue to work. The new AES-GCM and AES-GCM-SIV modes are additional options you can choose to use for new encryption setups.

How does the verbose flag help with test debugging?
The -verbose flag outputs detailed information about each test operation as it executes, including which checks are being run and their results. This makes it much easier to identify exactly where and why a test is failing without having to add debug statements to your test code.

Releases In Branch 1.8

Version Release date
1.8.5 1 year ago
(June 05, 2024)
1.8.4 1 year ago
(May 22, 2024)
1.8.3 1 year ago
(May 08, 2024)
1.8.2 1 year ago
(April 24, 2024)
1.8.1 1 year ago
(April 17, 2024)
1.8.0 2 years ago
(April 10, 2024)
1.8.0-rc2 2 years ago
(April 04, 2024)
1.8.0-rc1 2 years ago
(March 20, 2024)
1.8.0-beta1 2 years ago
(March 06, 2024)
1.8.0-alpha20240228 2 years ago
(February 28, 2024)
1.8.0-alpha20240216 2 years ago
(February 16, 2024)
1.8.0-alpha20240214 2 years ago
(February 14, 2024)
1.8.0-alpha20240131 2 years ago
(January 31, 2024)