Stable Release in branch 1.5
1.5.7
Released 07 Sep 2023
(3 years ago)
SoftwareTerraform
Version1.5
Initial release1.5.0
12 Jun 2023
(3 years ago)
Latest release1.5.7
07 Sep 2023
(3 years ago)
End of security fixes17 Jan 2024
(Ended 2 years ago)
Release noteshttps://github.com/hashicorp/terraform/blob/v1.5/CHANGELOG.md
Source codehttps://github.com/hashicorp/terraform/tree/v1.5
Documentationhttps://developer.hashicorp.com/terraform/docs
Downloadhttps://releases.hashicorp.com/terraform/
Terraform 1.5 ReleasesView full list

What Is New in Terraform 1.5

Terraform 1.5 introduces a major new workflow for safely testing provider and module changes directly within your configuration, alongside several key enhancements to the language and core functionality.

Category Key Changes
New Feature Introduces Terraform Testing: a native framework for creating and executing integration tests.
Language Enhancement Adds import block for predictable and plan-able resource import operations.
Improvement Enhances the terraform console with a revamped, more intuitive interface.
Improvement Adds the replace command to the terraform plan operation for targeted resource replacement.
Bug Fixes & Misc Various bug fixes and refinements across the core and built-in functions.

How does the new testing framework improve my workflow?

The new testing framework is the headline feature. It lets you write terraform test files to create integration tests for your modules and validate configuration changes before applying them to real infrastructure.

In practice, this means you can finally write tests that run a terraform plan or apply and make assertions on the output, all without needing external tooling. This is a game-changer for creating reliable, shareable modules.

What's the real benefit of the import block?

The import block makes importing existing infrastructure into your state a first-class, plan-able operation. You declare what you want to import directly in your configuration instead of using a one-off CLI command.

This matters because you can now review an terraform plan to see exactly how Terraform will handle the import before it happens. It eliminates the guesswork and potential for errors that came with the legacy terraform import command.

import {
  to = aws_instance.example
  id = "i-1234567890abcdef0"
}

Is the terraform console command actually useful now?

Yes, the terraform console command received a significant upgrade. The new interface includes helpful features like syntax highlighting, tab completion for resources and functions, and a much-improved history.

For developers debugging complex expressions or interpolations, this turns the console from a barely-used tool into an indispensable part of the daily workflow. It feels like a proper REPL now.

When should I use the new plan replace command?

Use the new -replace flag with terraform plan and apply when you need to force a specific resource to be destroyed and re-created. It's a more targeted and intuitive alternative to using taint.

This is perfect for those times when a resource is misbehaving and a simple update won't fix it. You can plan the replacement and see its impact on the rest of your infrastructure before executing it.

terraform plan -replace=aws_instance.example

FAQ

Can I use the new testing framework to test my existing modules?
Absolutely. You can create .tftest.hcl files alongside your existing modules to write tests that verify their behavior with different input variables, ensuring future changes don't introduce regressions.

Does the import block replace the old terraform import command?
Not yet. The traditional terraform import command is still available. The import block is the new, declarative method that integrates with the planning workflow, and it's the recommended path forward.

Are the new tests run automatically in CI/CD pipelines?
Yes. Since the terraform test command is a core part of the CLI, you can easily integrate it into your existing CI/CD pipelines to run your test suites automatically on every commit or pull request.

What happens if a test fails during a run?
The terraform test command will exit with a non-zero status code, clearly indicating the failure. The output will show which specific assertion in which test file did not pass, making it easy to pinpoint the issue.

Is the old taint command being deprecated?
While not officially deprecated in this release, the introduction of the -replace plan option provides a more modern and intuitive alternative. For most use cases, you should start using -replace instead of taint.

Releases In Branch 1.5

VersionRelease date
1.5.707 Sep 2023
(3 years ago)
1.5.623 Aug 2023
(3 years ago)
1.5.509 Aug 2023
(3 years ago)
1.5.426 Jul 2023
(3 years ago)
1.5.312 Jul 2023
(3 years ago)
1.5.228 Jun 2023
(3 years ago)
1.5.121 Jun 2023
(3 years ago)
1.5.012 Jun 2023
(3 years ago)
1.5.0-rc205 Jun 2023
(3 years ago)
1.5.0-rc131 May 2023
(3 years ago)
1.5.0-beta224 May 2023
(3 years ago)
1.5.0-beta115 May 2023
(3 years ago)
1.5.0-alpha2023050404 May 2023
(3 years ago)
1.5.0-alpha2023040505 Apr 2023
(3 years ago)