Upgrading Terraform and providers

Intermediate · 9 min

Upgrade Terraform and providers in small, boring steps: what the v1.x promises cover, release cadence from real dates, and a routine built on init -upgrade.

Before thisVersion constraints and the lock fileTerraform in CI: saved plans and approvals

Bryan Krausen · 9 min

Upgrading Terraform and providers

The player loads from youtube-nocookie.com when you press play. Nothing reaches YouTube before that.

Taught by Bryan KrausenReport a problem with this video
Not started
Set this lesson's status

What you'll learn

  • Terraform v1.x promises that working configurations keep working across 1.x releases, but excludes experiments, some commands and provider behaviour, and does not guarantee downgrades.
  • Providers carry no such promise: a major version can remove arguments, as the AWS v6 guide does with 49 resource and 20 data source sections.
  • Minor Terraform releases came about every 106 days from 1.9 to 1.17, so a year without upgrading is several minors behind.
  • Baseline plan first, upgrade one thing at a time, run init -upgrade, commit the lock file, plan every environment, roll out dev to prod, and update the pipeline pin together.

The module nobody dares touch

Every team has one. A Terraform root module pinned to a Terraform version from two years ago and an AWS provider from before the last major release. It works, so nobody touches it. Then a new resource type exists only in a newer provider, or a security fix lands in a version you cannot reach, or a colleague with a fresh laptop runs init and gets a different provider than CI. The longer you wait, the bigger the jump, and the less anyone remembers what the configuration was meant to do.

Upgrades are cheap when they are frequent and boring. The goal of this lesson is to make them boring: two kinds of upgrade, the order to do them in, and the evidence that tells you it is safe.

Two things you upgrade

Terraform itself, the CLI, changes the language, the state format and the commands. Providers are separate programs with their own versions, and they change what resources do. They move on different schedules and have different promises.

For Terraform, HashiCorp’s v1.x compatibility promises say that modules written for v1.0 should keep planning and applying without required changes throughout v1.x, and that you should be able to upgrade from any v1.x release to any later v1.x release, with no extra upgrade steps. The promises are narrower than they sound. They cover configurations that already work. They exclude experimental features, bug fixes (the page says it “cannot promise to always remain ‘bug-compatible’”), commands including import, state mv, state rm and workspace subcommands, and provider behaviour. They also say downgrading is not guaranteed, because a newer release may write state in a form older ones cannot read. That last point shapes how you roll out an upgrade: once a newer version has written the state, assume there is no way back.

Providers carry no such promise. A provider’s major version can remove arguments and resources. The AWS provider’s v6 upgrade guide, which I read on GitHub, has 49 Resource sections and 20 Data Source sections, one per affected resource or data source. One entry, for aws_eip, reads: remove vpc, it is no longer supported, use domain. Its prerequisites say to upgrade to the latest 5.x first, run a plan and confirm there are no unexpected changes or deprecation warnings, then change the version constraint and run terraform init -upgrade.

How fast things move

I pulled release dates for Terraform’s minor versions from the GitHub releases API and computed the gaps:

1.9  -> 1.10  154 days
1.10 -> 1.11   92 days
1.11 -> 1.12   76 days
1.12 -> 1.13   98 days
1.13 -> 1.14   91 days
1.14 -> 1.15  161 days
1.15 -> 1.16  119 days
1.16 -> 1.17   56 days
mean gap 106 days; versions behind if you stay on 1.12: 5

A new minor version arrives roughly every three to four months, and 1.17.0 shipped on 21 October 2026; the latest patch on 28 November 2026 was 1.17.2. If you stay on a version you are five minors behind in under two years. The AWS provider shows the other side: v5.0.0 was 25 May 2023, v6.0.0 was 18 June 2025, and the latest I saw was v6.74.0 on 23 November 2026. Providers release often, which makes version pinning and a deliberate upgrade routine matter more, as the lock-file lesson set up.

A routine that works

  1. Read what is changing. The Terraform upgrade guides for each minor, the provider’s CHANGELOG and, for a major, its upgrade guide. Start with deprecation warnings in your current plan output, because those are the ones the provider has already told you about.
  2. Get a clean baseline. A plan on the current versions must show no changes. If it does not, you cannot tell afterwards whether the upgrade or the drift caused them.
  3. Upgrade one thing at a time. Terraform core in one pull request, then providers, then modules. The upgrade guide for the AWS provider’s major version says to move to the latest of the previous major first.
  4. Change the pins, then run terraform init -upgrade. This is the command that lets Terraform choose newer versions inside your constraints and rewrites .terraform.lock.hcl. A plain init keeps the locked versions. Commit the updated lock file, because it is what CI and teammates will use.
  5. Plan in every environment and read it. The goal is a plan with no changes, or only changes you can explain. A provider upgrade that wants to replace a database is a stop sign, not something to apply at the end of the day.
  6. Roll out environment by environment. Dev first, then staging, then production, each with its own state, as in the environments lesson. Because state upgrades do not reverse, the ordering is what gives you an escape.
  7. Update the pipeline’s pinned version in the same change. If CI plans with 1.16 and your laptop applies with 1.17, the saved-plan rule from the CI lesson will bite.

When upgrades go wrong

Common causes: an unpinned provider jumped a major version because the constraint was >= 3.0; a lock file was not committed, so CI and laptops differ; a moved block was skipped when a resource was renamed in the provider, so the plan wants to destroy and create; a module still pins an old provider and conflicts. For the rename case, moved blocks are the tool. For the “I cannot go back” case, remember that state versioning on the backend, such as S3 object versioning, is your recovery path. Before upgrading production, copy the state down.

OpenTofu

OpenTofu has its own release line, v1.13.10 on 28 November 2026. Moving between the two tools is a separate upgrade, covered in the last lesson of this group, with the same discipline: baseline plan, one change at a time, a state backup.

About the video

The embed is Bryan Krausen’s “Upgrading a Terraform Provider or Module”, 8 minutes 36 seconds, March 2025. Its description says it upgrades the AWS provider to a new version in order to use a newly added data source, without disturbing existing resources, and it comes from his HashiCorp Terraform course. It covers providers, not Terraform core upgrades, and it was published before AWS provider v6.0.0 in June 2025, so it will not show a major-version migration. I did not watch it fully. English was judged from the title, description, channel and its English auto-caption track. There is no second video in deeper, since I found none that covered upgrade practice rather than a single command.

Where this fits

The last upgrade this group covers is the biggest one: swapping the tool itself. OpenTofu versus Terraform, state encryption and migration finishes it.

Check yourself

  1. 01Why can you not count on downgrading Terraform after an apply?

    The v1.x promises do not guarantee it, and a newer version can write state that older ones cannot read.

  2. 02What does terraform init -upgrade do that init does not?

    It lets Terraform pick newer provider versions inside your constraints and rewrites the lock file, where plain init keeps the locked versions.

  3. 03Why get a no-changes baseline plan before upgrading?

    Otherwise you cannot tell whether later changes came from the upgrade or from drift.

Go deeper

Notes

Private to you

Esc
↑↓ navigate↵ open? shortcuts

Keyboard shortcuts

Press Esc to close

Anywhere

⌘K
Search and commands
/
Search
?
This sheet
Esc
Close

Reading a lesson

J
Next lesson
K
Previous lesson
B
Bookmark