HashiCorp Terraform Associate (003) — All Questions
3 questions
In Terraform, what is the role of a provider?
- a.It stores the remote state file
- b.It defines reusable groups of resources
- c.It is a plugin that lets Terraform interact with a specific API, such as a cloud platform or SaaS✓
- d.It formats configuration to canonical style
A provider is a plugin that understands a particular API (AWS, Azure, GitHub, Kubernetes, and many others) and exposes its resource and data source types to Terraform. Providers are declared and their versions constrained so runs are reproducible. State storage is a backend concern, and reusable resource groups are modules.
Which capability is a distinguishing benefit of using Terraform Cloud or Terraform Enterprise compared with running Terraform purely from a laptop?
- a.It removes the need to write any HCL configuration
- b.It eliminates the concept of Terraform state entirely
- c.It only supports a single cloud provider
- d.It provides remote runs, secure remote state storage, and team access controls✓
Terraform Cloud adds remote execution of plans and applies, secure and shared remote state, VCS-driven workflows, policy enforcement, and team-based access controls. It still uses HCL and state, and it supports many providers. These collaboration and governance features are its main advantages over ad hoc local runs.
Why should you pin or constrain provider versions in the required_providers block?
- a.To ensure reproducible runs and avoid unexpected breaking changes from newer provider releases✓
- b.Because Terraform cannot download providers without an exact version
- c.To make plans run faster by skipping the dependency graph
- d.Because version constraints are required to store remote state
Constraining provider versions makes runs reproducible across machines and over time, preventing a newer provider release from silently introducing breaking changes. The lock file records the selected versions. Terraform can resolve providers from constraints without an exact pin, and version constraints are unrelated to plan speed or state storage.