โ Terraform Associate Exam Practice learning pathTerraform Associate Exam Practice ยท Module 7 of 10
Providers and the lock file
Versions and multiple configurations.
๐ Key ideas
- Providers are declared in required_providers with source and version constraints.
- The dependency lock file (.terraform.lock.hcl) records exact provider versions and hashes; commit it.
- terraform init -upgrade updates providers within constraints.
- Provider aliases allow multiple configurations (e.g., two regions).
- 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