โ† Terraform Associate Exam Practice learning path
Terraform Associate Exam Practice ยท Module 7 of 10

Providers and the lock file

Versions and multiple configurations.

๐Ÿ“– Key ideas

  1. Providers are declared in required_providers with source and version constraints.
  2. The dependency lock file (.terraform.lock.hcl) records exact provider versions and hashes; commit it.
  3. terraform init -upgrade updates providers within constraints.
  4. Provider aliases allow multiple configurations (e.g., two regions).
  5. Version constraint ~> 5.0 allows 5.x but not 6.0.
๐Ÿ’ก Real-life example: Like a recipe that specifies exact brand and pack size so every cook gets the same result.
required_providersBlock declaring provider sources and versions
Lock file.terraform.lock.hcl recording exact versions
Provider aliasSecond configuration of the same provider
Version constraintRule for acceptable versions