With respect to providers, what does terraform init do?
Choose one.
Provider installation is one of terraform init's core jobs. Terraform reads the required_providers block, selects versions that satisfy the constraints, downloads the plugins, and records the selections in the dependency lock file.
Providers are executable plugins that Terraform Core does not ship with, so they must be fetched before any other command can use them. init performs that download into the local .terraform directory and writes .terraform.lock.hcl so future runs select identical versions. It does not publish anything, does not create infrastructure, and does not test credentials - those misconceptions confuse init with apply or with provider development workflows.
- Declare providers and version constraints in the required_providers block.
- Run terraform init to download matching provider plugins into .terraform.
- Check the generated .terraform.lock.hcl into version control so teammates get the same versions.
Exam tip: terraform init downloads and locks provider plugins; it never touches real infrastructure.
Terraform init, validate, and plan: the core workflow explained — the lesson that teaches this.