Terraform AWS Provider 6 Upgrade Guide: Breaking Changes and a Safe Migration Path

A Terraform AWS provider 6 upgrade is overdue for a surprising number of teams. Version 6.0 reached general availability on 18 June 2025, and by late October 2026 the 6.x line had already passed v6.71.0. Many repositories are still pinned to ~> 5.0, which means every new AWS feature, fix and service now lands in a version they cannot use.

The jump is worth it. Provider 6 introduces Enhanced Region Support, a region argument on most resources that removes the need for one provider alias per region. It also removes dead services such as OpsWorks, SimpleDB and WorkLink, tightens boolean validation and changes several defaults.

This guide lists the breaking changes that actually affect real codebases, shows how to find them before terraform plan does, and walks through a safe Terraform AWS provider 6 upgrade with HCL, Bash and Python examples.


Table of Contents

  1. Technical Overview & Background
  2. Breaking Changes That Matter Most
  3. Core System Prerequisites
  4. Step-by-Step Terraform AWS Provider 6 Upgrade
  5. Architecture & Component Breakdown
  6. Real-World Use Cases & Enterprise Examples
  7. Troubleshooting, Edge Cases & Best Practices
  8. FAQ
  9. Summary & Key Takeaways

Technical Overview & Background

The hashicorp/aws provider is the plugin that translates Terraform (and OpenTofu) configuration into AWS API calls. It is by far the most downloaded provider in the public registry.

Major versions arrive roughly every two years and are the only releases allowed to contain breaking changes.

Provider release timeline

VersionMilestone
4.0Split aws_s3_bucket into many smaller resources
5.0Default tags improvements, removal of EC2-Classic
6.0GA on 18 June 2025: Enhanced Region Support, removed services, stricter booleans
6.71.0Released 28 October 2026, illustrating how far 6.x has moved

Every minor release in the 6.x line adds resources and fixes. Staying on 5.x means missing more than a year of AWS coverage.

What Enhanced Region Support changes

Before 6.0, each provider configuration targeted one region. Multi-region stacks needed aliases:

# Provider 5.x pattern: one alias per region
provider "aws" {
  region = "eu-west-1"
}

provider "aws" {
  alias  = "use1"
  region = "us-east-1"
}

resource "aws_s3_bucket" "replica" {
  provider = aws.use1
  bucket   = "orders-replica-use1"
}

In 6.x, most resources accept a region argument directly:

# Provider 6.x pattern: one provider, per-resource region
provider "aws" {
  region = "eu-west-1"
}

resource "aws_s3_bucket" "replica" {
  region = "us-east-1"
  bucket = "orders-replica-use1"
}

Global services such as IAM, CloudFront and Route 53 do not take region. HashiCorp also notes the change reduces memory use, because Terraform loads fewer provider instances.

Breaking Changes That Matter Most

The official upgrade guide is long. In practice, these are the changes that break most codebases.

Removed services and resources

  • OpsWorks Stacks: all 17 aws_opsworks_* resources are gone
  • SimpleDB: aws_simpledb_domain removed
  • WorkLink: aws_worklink_fleet and its association resource removed
  • aws_redshift_service_account: removed; use a service principal in IAM policies
  • Provider endpoints: opsworks, simpledb/sdb and worklink entries removed

If you still manage any of these, keep that state in a separate root module pinned to 5.x until you retire it.

Changed arguments on common resources

ResourceChange in 6.0What to do
aws_instancecpu_core_count and cpu_threads_per_core removedUse a cpu_options block
aws_instanceuser_data stored in clear text, no longer hashedUse user_data_base64 for encoded data; expect a one-time plan diff
aws_eipvpc removedUse domain = "vpc"
aws_eks_addonresolve_conflicts removedUse resolve_conflicts_on_create and resolve_conflicts_on_update
aws_flow_loglog_group_name removedUse log_destination
aws_ssm_associationinstance_id removedUse targets
aws_api_gateway_deploymentstage_name and stage settings removedManage stages with aws_api_gateway_stage
aws_dms_endpoints3_settings removedUse aws_dms_s3_endpoint
aws_launch_templateElastic GPU and Elastic Inference blocks removedDelete those blocks
aws_spot_instance_requestblock_duration_minutes removedDelete the argument

Changed defaults to fix before the Terraform AWS provider 6 upgrade

  • aws_redshift_cluster: encrypted now defaults to true and publicly_accessible to false.
  • aws_wafv2_web_acl: Bot Control enable_machine_learning now defaults to false.
  • aws_elasticache_replication_group: auth_token_update_strategy has no default and is required when auth_token is set.

Changed defaults are dangerous because they can produce in-place updates or replacements on resources you did not edit. Always set these arguments explicitly before upgrading.

Stricter boolean validation

Several nested boolean attributes no longer accept "0" or "1". Examples include delete_on_termination and encrypted in aws_launch_template EBS blocks, preserve_client_ip on target groups and auto_minor_version_upgrade on ElastiCache. Use true, false or leave them unset.

Data source changes

  • aws_ami with most_recent = true now requires owners or an image or owner filter. This closes a real supply-chain risk.
  • aws_region: name is deprecated in favour of region.
  • aws_s3_bucket: use the new bucket_region attribute; region now means Enhanced Region Support.
  • aws_identitystore_user / _group: filter removed; use alternate_identifier.

Renamed region arguments

Where a resource already had a region argument with a different meaning, it was renamed. Examples:

  • aws_vpc_peering_connection data source: region → requester_region
  • aws_vpc_endpoint_service data source: region → service_region
  • aws_cloudformation_stack_set_instance: region → stack_set_instance_region
  • aws_config_aggregate_authorization: region → authorized_aws_region
  • aws_dx_hosted_connection: region → connection_region

Core System Prerequisites

Before starting a Terraform AWS provider 6 upgrade, have these in place:

  • The latest 5.x provider applied cleanly, with no deprecation warnings left unexplained
  • A recent Terraform or OpenTofu release (see our OpenTofu vs Terraform comparison)
  • Remote state with locking (S3 with native locking or DynamoDB, HCP Terraform, or similar)
  • State backups or versioning on the state bucket
  • CI that runs plan on every change, so reviewers see diffs before apply
  • Module versions that support provider 6, especially community modules such as terraform-aws-modules
  • A non-production environment that uses the same modules as production

Step-by-Step Terraform AWS Provider 6 Upgrade

Estimate the effort before you start

A quick sizing exercise keeps the Terraform AWS provider 6 upgrade from turning into an open-ended project:

  1. Count root modules and how many share the same internal modules. Shared modules multiply the benefit of each fix.
  2. Run the scan script in Step 2 across every repository and group the findings by type.
  3. Flag stateful resources (databases, Redshift, ElastiCache, EBS-backed instances) where a surprise replacement would cause an outage.
  4. Check third-party modules for provider 6 support and note any that need a fork or replacement.
  5. Book the work in small batches: modules first, then dev, staging and production.

Most teams find that a handful of patterns account for almost all of the work, which makes the upgrade easy to parallelise.

Using OpenTofu instead of Terraform

The same hashicorp/aws provider works with OpenTofu, served through the OpenTofu registry. The breaking changes, Enhanced Region Support and upgrade steps in this guide apply unchanged. Run tofu init -upgrade and tofu providers lock in place of the Terraform commands.

Step 1: Finish the 5.x line first

The official guidance is to move to the latest 5.x release, run terraform plan, and clear every error and deprecation warning before touching 6.0:

terraform init -upgrade
terraform plan -out=tfplan-5x 2>&1 | tee plan-5x.log
grep -i "deprecat" plan-5x.log | sort -u

Most deprecation warnings in late 5.x point directly at things 6.0 removes.

Step 2: Scan your code for known breaking changes

Before changing the version, search every repository. This Python script flags the most common v6 breakages:

#!/usr/bin/env python3
"""tf_v6_scan.py - flag Terraform code likely to break on AWS provider 6.0."""
import pathlib
import re
import sys

CHECKS = {
    r'resource\s+"aws_opsworks_': "OpsWorks resources removed in 6.0",
    r'resource\s+"aws_simpledb_domain"': "SimpleDB removed in 6.0",
    r'"aws_worklink_': "WorkLink removed in 6.0",
    r'aws_redshift_service_account': "Removed: use a service principal",
    r'\bcpu_core_count\b|\bcpu_threads_per_core\b': "aws_instance: move to cpu_options",
    r'^\s*vpc\s*=\s*true': "aws_eip: use domain = \"vpc\"",
    r'^\s*resolve_conflicts\s*=': "aws_eks_addon: use resolve_conflicts_on_create/_on_update",
    r'\blog_group_name\b': "aws_flow_log: use log_destination",
    r'\bblock_duration_minutes\b': "aws_spot_instance_request: removed",
    r'elastic_gpu_specifications|elastic_inference_accelerator': "launch template: block removed",
    r'=\s*"[01]"': "Possible string boolean; use true/false",
    r'most_recent\s*=\s*true': "aws_ami: make sure owners is set",
}

root = pathlib.Path(sys.argv[1] if len(sys.argv) > 1 else ".")
hits = 0
for tf in root.rglob("*.tf"):
    if ".terraform" in tf.parts:
        continue
    for n, line in enumerate(tf.read_text(errors="ignore").splitlines(), 1):
        for pattern, msg in CHECKS.items():
            if re.search(pattern, line):
                hits += 1
                print(f"{tf}:{n}: {msg}\n    {line.strip()}")

print(f"\n{hits} potential issue(s) found")

Treat the output as a to-do list, not a verdict. The aws_ami match, for example, only matters if owners is missing.

Step 3: Fix the code while still on 5.x where possible

Many fixes are backwards compatible, so you can merge them before the version bump. For aws_instance:

resource "aws_instance" "app" {
  ami           = data.aws_ami.al2023.id
  instance_type = "c7i.2xlarge"

  # 6.x: replaces cpu_core_count / cpu_threads_per_core
  cpu_options {
    core_count       = 4
    threads_per_core = 1
  }

  user_data_base64 = base64encode(templatefile("${path.module}/userdata.sh", {}))
}

data "aws_ami" "al2023" {
  most_recent = true
  owners      = ["amazon"]            # now mandatory with most_recent

  filter {
    name   = "name"
    values = ["al2023-ami-*-x86_64"]
  }
}

And for other common resources:

resource "aws_eip" "nat" {
  domain = "vpc"                      # replaces vpc = true
}

resource "aws_eks_addon" "vpc_cni" {
  cluster_name                = aws_eks_cluster.main.name
  addon_name                  = "vpc-cni"
  resolve_conflicts_on_create = "OVERWRITE"
  resolve_conflicts_on_update = "PRESERVE"
}

resource "aws_redshift_cluster" "analytics" {
  cluster_identifier  = "analytics"
  node_type           = "ra3.xlplus"
  encrypted           = true          # set explicitly; default changed in 6.0
  publicly_accessible = false         # set explicitly; default changed in 6.0
  # ...
}

Setting changed defaults explicitly makes the plan identical before and after the upgrade.

Step 4: Bump the constraint and re-initialise

Update required_providers in every root module:

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 6.0"
    }
  }
}

Then upgrade the lock file for every platform your team and CI use:

terraform init -upgrade
terraform providers lock \
  -platform=linux_amd64 \
  -platform=linux_arm64 \
  -platform=darwin_arm64
git add .terraform.lock.hcl

Committing a multi-platform lock file prevents “checksum mismatch” errors between laptops and CI runners.

Step 5: Review the plan for destroys and replacements

A Terraform AWS provider 6 upgrade should produce configuration errors, not silent infrastructure changes. Fail CI if the plan contains a delete:

terraform plan -out=tfplan
terraform show -json tfplan > tfplan.json

jq -r '.resource_changes[]
  | select(.change.actions | index("delete"))
  | "\(.change.actions | join("/"))  \(.address)"' tfplan.json

DELETES=$(jq '[.resource_changes[] | select(.change.actions | index("delete"))] | length' tfplan.json)
if [ "$DELETES" -gt 0 ]; then
  echo "Plan contains $DELETES destroy/replace actions - review before apply"
  exit 1
fi

Expect some in-place updates, for example on aws_instance.user_data because state now holds clear text instead of a hash. Read each one; do not bulk-approve.

Step 6: Apply environment by environment

Roll out the Terraform AWS provider 6 upgrade by applying the same commit to dev, then staging, then production. Keep the previous lock file commit available as a rollback path for at least a day after each apply.

Step 7: Migrate provider aliases to the region argument

Do this after the upgrade has been applied and is stable. HashiCorp recommends refreshing state first:

terraform plan -refresh-only
terraform apply -refresh-only

Then replace provider = aws.use1 with region = "us-east-1" on each resource and confirm the plan shows no changes. For imports, 6.x accepts a region suffix on the ID, and import blocks can set region directly:

import {
  to     = aws_s3_bucket.replica
  id     = "orders-replica-use1"
  region = "us-east-1"
}

Move one module at a time. Remove unused provider aliases only after every resource has been migrated.

Architecture & Component Breakdown

How Terraform talks to AWS

  1. Terraform core reads configuration, state and the lock file.
  2. It starts the hashicorp/aws provider plugin pinned in .terraform.lock.hcl.
  3. The provider builds AWS SDK clients per service and per region.
  4. In 5.x, each provider alias was a separate plugin configuration with its own region and clients.
  5. In 6.x, one configuration can create clients for multiple regions, chosen by each resource’s region argument.
  6. Results flow back into state, which now records the region for regional resources.
Terraform AWS provider 6 upgrade path in six steps and the 5.x versus 6.x multi-region configuration
The Terraform AWS provider 6 upgrade path and the move from provider aliases to per-resource regions.

5.x vs 6.x at a glance

AreaProvider 5.xProvider 6.x
Multi-regionOne alias per regionregion argument per resource
Import across regionsNeeds matching alias@region suffix or import block region
OpsWorks, SimpleDB, WorkLinkSupportedRemoved
aws_instance CPU settingscpu_core_countcpu_options block
aws_instance.user_data in stateHashedClear text
Redshift defaultsUnencrypted, publicEncrypted, private
aws_ami + most_recentOwners optionalOwners required
String booleans ("0", "1")Often acceptedRejected in listed attributes

Terraform AWS provider 6 upgrade order across a large estate

  1. Shared modules first, released as a new major version that supports provider 6
  2. Low-risk root modules (sandbox, dev)
  3. Platform modules (networking, IAM, EKS)
  4. Data and production stacks last, with change windows

Real-World Use Cases & Enterprise Examples

Scenario 1: Multi-region disaster recovery stack

A team runs primary infrastructure in eu-west-1 and a warm standby in eu-central-1. Their modules accepted two provider aliases and passed them down through three layers.

After upgrading, they replace aliases with a dr_region variable and set region = var.dr_region on standby resources. The module interface becomes simpler, and plans run faster with fewer provider instances.

Scenario 2: Legacy OpsWorks state

An older account still has OpsWorks stacks managed by Terraform. The 6.0 plan fails because those resource types no longer exist.

The team moves the OpsWorks resources into a separate root module pinned to provider 5.x, schedules the retirement of the stacks, and upgrades everything else immediately. The rest of the estate is no longer blocked by one legacy service.

Scenario 3: Silent Redshift change caught in review

The CI destroy check flags a planned replacement of an aws_redshift_cluster. The cluster had never set encrypted, and the new default is true.

They set encrypted = false explicitly to match reality, apply without replacement, and plan a separate, deliberate encryption migration.

Scenario 4: EKS platform module

A platform team’s EKS module used resolve_conflicts = "OVERWRITE" on every add-on. They split it into resolve_conflicts_on_create and resolve_conflicts_on_update, release a new module major version, and roll it out with their EKS upgrades. See our EKS extended support cost guide for why those upgrades matter.

Troubleshooting, Edge Cases & Best Practices

Common Terraform AWS provider 6 upgrade errors and fixes

“The provider hashicorp/aws does not support resource type aws_opsworks_stack”

The resource was removed in 6.0. Move it to a separate root module on 5.x, or remove it from state with terraform state rm once it is no longer managed.

“Unsupported argument: cpu_core_count”

Replace it with a cpu_options block containing core_count and threads_per_core.

“Your query returned more than one result” or a validation error on aws_ami

Add owners (for example ["amazon"] or your account ID). Avoid the allow_unsafe_filter override.

Unexpected in-place update to user_data

State now stores clear text instead of a hash. Confirm the content is identical and apply; switch to user_data_base64 where you pass encoded data.

Module fails with “Unsupported argument” after the upgrade

A community or internal module still uses removed arguments. Upgrade the module to a release that supports provider 6, or fork and fix it.

Checksum mismatch errors in CI

The lock file only contains hashes for one platform. Run terraform providers lock with all required platforms and commit the result.

Rollback planning for a Terraform AWS provider 6 upgrade

  • Before apply: revert the version constraint and lock file; nothing in AWS has changed.
  • After apply: state written by 6.x may not be readable by 5.x for some resources. Restore the previous state version from your backend, then revert the code.
  • Always keep state versioning enabled and know how to restore a specific version.

Terraform AWS provider 6 upgrade best practices

  • Upgrade one major version at a time (4 → 5 → 6), never two at once.
  • Clear deprecation warnings on the latest 5.x before bumping.
  • Set changed defaults explicitly so plans stay quiet.
  • Fail CI on unexpected deletes and review every in-place change.
  • Commit multi-platform lock files.
  • Upgrade modules before root modules.
  • Adopt Enhanced Region Support gradually, after the version upgrade is stable.
  • Keep current within 6.x with automated dependency updates, so the next major is a small step.

FAQ

When was Terraform AWS provider 6.0 released?

HashiCorp announced general availability of version 6.0 of the Terraform AWS provider on 18 June 2025. The 6.x line has been updated frequently since then and reached v6.71.0 by late October 2026.

What is Enhanced Region Support in AWS provider 6?

Enhanced Region Support adds a region argument to most regional resources and data sources. One provider configuration can then manage resources in several AWS Regions without a separate provider alias per region. Global services such as IAM, CloudFront and Route 53 do not use it.

What are the main breaking changes in Terraform AWS provider 6?

OpsWorks, SimpleDB and WorkLink resources were removed. Common resources changed too: aws_instance replaced cpu_core_count with cpu_options, aws_eip replaced vpc with domain, and aws_eks_addon split resolve_conflicts. String booleans are rejected in many attributes, aws_ami with most_recent needs owners, and Redshift now defaults to encrypted and private.

Can I upgrade directly from AWS provider 4.x to 6.x?

It is not recommended. Upgrade one major version at a time: move to the latest 5.x, apply it, clear deprecation warnings, then move to 6.x. Stacking two sets of breaking changes makes failures much harder to diagnose.

How do I roll back if the provider 6 upgrade goes wrong?

Before any apply, simply revert the version constraint and lock file. After an apply, state written by 6.x may not be readable by 5.x, so restore the previous state version from your backend’s versioning, then revert the code. Keep state versioning enabled for this reason.

Summary & Key Takeaways

  • Terraform AWS provider 6.0 has been GA since 18 June 2025; the 6.x line reached v6.71.0 by late October 2026.
  • Enhanced Region Support adds a region argument to most resources, replacing per-region provider aliases.
  • Removed: OpsWorks, SimpleDB, WorkLink and aws_redshift_service_account.
  • Common breakages: cpu_core_count, aws_eip.vpc, aws_eks_addon.resolve_conflicts, aws_flow_log.log_group_name, string booleans and aws_ami without owners.
  • Changed defaults on Redshift, WAFv2 and ElastiCache can trigger unexpected changes; set them explicitly.
  • Upgrade safely: latest 5.x first, scan code, bump the constraint, block destroys in CI, then migrate aliases to region.

A Terraform AWS provider 6 upgrade is mostly mechanical once you know where the sharp edges are. Scan, fix on 5.x, bump, and let a destroy-blocking CI check catch anything you missed.

Editorial note: Breaking changes come from the official AWS Provider Version 6 Upgrade Guide. Release dates follow HashiCorp’s Terraform AWS provider 6.0 GA announcement and the provider release history. The scan script is a starting point, not a complete compatibility check; always review a full plan.

Leave a Comment