Connect providers, versions and state
Explain provider installation, independent configurations and the binding between an address and a real object.
Connect providers, versions and state
A provider requirement identifies the provider source and an acceptable version range. A provider configuration supplies settings such as the target region. An alias gives an additional configuration of the same provider a distinct name. A resource selects an alias explicitly when it should use the alternate configuration. Modules declare their own provider requirements and can receive configurations from a caller.
Initialization resolves compatible provider versions and installs the plugins. Commit the dependency lock file so routine initialization can reproduce the selected versions and verify checksums. State binds resource addresses to provider-managed objects. The lock file does not record those object identities or pin remote module releases. Treat state and pipeline credentials as sensitive operational data.
Worked case 1
Two developers use the same provider version constraint but a new checkout selects a different compatible release. What should the team inspect?
Check your reasoning
Check whether the dependency lock file was committed and honored. A constraint allows a range. The lock file records the selected release and expected checksums.
Worked case 2
A workload and its replica belong in different regions using the same provider binary. Do they need separate provider sources?
Check your reasoning
Configure two instances of that provider, using an alias for the alternate region. Associate the replica resource or child module with the appropriate configuration.
HashiCorp objective references: 2a–2d.
Provider requirements and version constraints · Official Terraform 004 objectives for this domain
Related lesson in AWS Certified Developer – Associate. Package a reproducible release.
Practice with the recording
The lock file changes on a second operating system. What should the reviewer check before approving it?
Check your reasoning
Compare the selected provider version, source address and recorded package checksums. Populate checksums for the supported platforms through the provider lock workflow. Investigate an unexpected checksum for the same package before accepting a new lock file.
Practice the individual exam skills
- 2a–2d Initialize a configuration with two provider aliases and identify which resource uses each one. Distinguish the version constraint, the locked package and the state binding that identifies a remote object.
Connect providers, versions and state quiz
Answer 3 questions. Check each answer for an explanation.