Concept and mechanism
A provider implements API communication and defines supported resources and data sources. required_providers identifies source and acceptable versions; required_version constrains Terraform CLI. The.terraform.lock.hcl file records provider selections and checksums, not infrastructure state or remote module versions. Multiple configurations of one provider can use aliases for different regions or contexts. State retains the relationship between a configuration address and remote-object identity; losing that binding does not delete the object.
Guided application
During a planned upgrade, review version changes separately from functional changes. Keep the lock under version control and inspect the plan after initialization. If another operator gets a different result, compare revision, Terraform version, lock, arguments, and authentication context. For resources in a secondary region, make provider configuration explicit. Do not use a name containing “dr” as evidence that a resource was placed in the correct recovery destination.
The resource is named reports_dr but still uses the default provider. Reviewing the alias reveals that the intended region was never selected.
Common pitfalls
Confusing provider lock files with state locking; deleting state as though it were cache.
Related topics: Workflow, validation, and plans · Configuration, dependencies, and secrets
Reproducible versions and correct identity are different parts of predictability.
Reference: Provider requirements · 004