Interview Prep/Terraform/Workflow and CLI

What does `terraform init` do?

BeginnerConceptWorkflow and CLI
Answer

It prepares a working directory: configures the backend, downloads required providers and modules, and writes .terraform.lock.hcl. It is safe to re-run. Run it after adding a provider, changing module sources or switching backends.

terraform init
terraform init -upgrade   # re-resolve provider and module versions
All Terraform questions Roadmap: Terraform

More on Workflow and CLI