Which THREE are valid use cases for the 'terraform state replace-provider' command?
Migrating a provider between registries requires rewriting every stored provider address in state, since Terraform resolves providers by registry-qualified source address. The replace-provider command performs exactly this state-wide substitution, updating the recorded provider references without touching real infrastructure, satisfying the registry-migration use case.
Why this answer
Option A is correct because 'terraform state replace-provider' rewrites the provider source address recorded in the state file, which is exactly what is needed when a provider moves from registry.terraform.io to a private registry. Option D is correct because migrating from a community provider to an official provider is a change of provider source address in state, and this command updates those references without forcing resource re-creation. Option E is correct because changing the provider source from one namespace to another (e.g., hashicorp/aws to mycompany/aws) is precisely the provider address substitution the command performs.
Option B is not correct because upgrading a provider to a new major version is done by changing the version constraint and running 'terraform init -upgrade', not by replacing the provider source in state. Option C is not correct because changing a provider's configuration region is a configuration change in the provider block, not a state provider address replacement.
Exam trap
The exam often tests the distinction between state-level provider address changes (source/registry) versus configuration-level changes (version, region, or provider block attributes), and candidates mistakenly think `state replace-provider` can handle version upgrades or configuration edits.