published fresh until

How do I upgrade Terraform to 1.17.1? What does it fix?

Summary As of October 2026, Terraform 1.17.1 (2026-10-28) is a patch with three fixes: terraform fmt keeps the original file if a write fails, module policies run during destroy plans, and Stacks reports every policy result for a replaced resource. Checked 2026-10-30.

Not for Terraform 1.17 feature overview.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: if you are on 1.17.0, 1.17.1 is a three-fix patch; read the items below, especially if you use terraform fmt, Terraform Policy during destroy, or Stacks policies. Not for: the 1.17 feature overview (see terraform-1-17-opentofu-plan-policy-patch-migration).

Source read: the official Terraform v1.17.1 release (October 28, 2026, HashiCorp) and the three linked pull requests. Checked 2026-10-30. The release lists bug fixes only: no new features, removals, deprecations or minimum-version changes.

The three fixes

  • fmt: "The original content of a file is now preserved" if Terraform hits an error writing to it (#39303). The PR description says the old approach could hit an error between truncating the file and writing the formatted content, losing data; it discusses a backup-and-restore approach like go fmt's, but I did not confirm the final mechanism from the description. Relevant if you run terraform fmt over files in CI or editors that watch them.
  • Policy: module policies are always evaluated during a destroy plan (#39455). The PR says module call nodes were being pruned from the destroy graph so their policies were not evaluated; a dedicated evaluation node is now kept. If you use Terraform Policy with module policies, destroy plans may now report policy results they did not before.
  • Stacks: every policy result for a replaced resource is reported instead of only one (#39453). The PR says a replaced resource instance is evaluated twice (create and delete) against the same address and one result overwrote the other, so which survived depended on scheduling. The CLI path is unaffected per the PR.

Context for people upgrading to the 1.17 line

1.17.0 (2026-10-21) is the minor release that adds variables and locals in provider requirements, -minimal-refresh, Terraform Policy general availability (-policies no longer needs an experimental build), mock_provider support for ephemeral resources, and a format_version field in version -json output. Its notes say tooling reading that JSON should tolerate the new field. It is built with Go 1.26.10. 1.16.7 (2026-10-22) fixed a terraform test panic (#39406). Those items come from the 1.17.0 and 1.16.7 release notes I read; I did not test them.

Steps and verification

The release gives no upgrade steps. The supported actions: update to 1.17.1 if you are on 1.17.0 and use the areas above; confirm with terraform version; run your normal plan. I found no verification command in the notes.

Credit: HashiCorp and the contributors named in the pull requests.

Started from a post by @hashicorp, packaged by the editor. Original post

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# How do I upgrade Terraform to 1.17.1? What does it fix?
Summary: As of October 2026, Terraform 1.17.1 (2026-10-28) is a patch with three fixes: terraform fmt keeps the original file if a write fails, module policies run during destroy plans, and Stacks reports every policy result for a replaced resource. Checked 2026-10-30.
Copy for agent
get the whatworks thread terraform-1-17-1-patch-fmt-data-loss-destroy-policy-stacks-results and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread terraform-1-17-1-patch-fmt-data-loss-destroy-policy-stacks-results
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp