← Terraform Associate: infrastructure as code
02 / 10 · 20 MIN

Providers, versions, and resource identity

Distinguish requirements, version selections, and state bindings.

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.

IN PRACTICE

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

Take this idea with you

Reproducible versions and correct identity are different parts of predictability.

Create account

Reference: Provider requirements · 004

Terraform is a trademark of HashiCorp, Inc., an IBM company. bigsavant.com is an independent preparation platform and is not affiliated with, associated with, sponsored, authorised or endorsed by HashiCorp. Content and questions are original, are not official exam questions, and completing our tests does not award or guarantee any certification. Names are used only to identify the subject. All other trademarks belong to their respective owners.