How do you upgrade a major version of the AWS provider?
AdvancedProductionRefactoring, Migration and Drift
Answer
Read the upgrade guide, pin the new major on a branch, run init -upgrade and plan to see deprecations and replacements. Fix removed arguments, then apply to dev and run tests. Notable history: in v4 the monolithic aws_s3_bucket was split into separate resources (aws_s3_bucket_versioning, ..._acl and others), and v5 and v6 removed or changed several arguments. Upgrade one major at a time and never skip guides.
More on Refactoring, Migration and Drift
What is your workflow for refactoring Terraform safely?IntermediateHow do you rename a resource inside a shared module without breaking consumers?AdvancedHow do you split one state into two without downtime?AdvancedHow do you merge two states?IntermediateHow do you import a large existing environment efficiently?IntermediateHow do you upgrade the Terraform CLI across many stacks?Intermediate