Interview Prep/Terraform/Refactoring, Migration and Drift

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.

All Terraform questions Roadmap: Terraform in production

More on Refactoring, Migration and Drift