.terraform directory
The hidden folder terraform init creates beside your configuration, holding downloaded providers, fetched modules and backend settings.
In more detail
It is disposable: delete it and run terraform init again and you are back where you were. Never commit it; add it to .gitignore. Providers are stored under a path made from the registry host, namespace, name, version and platform.
Example
.terraform/providers/registry.terraform.io/hashicorp/local/2.5.2/darwin_arm64/Related terms
- terraform init — The command that prepares a directory for Terraform: it downloads providers, fetches modules, connects the backend and writes the lock file.
- dependency lock file — The .terraform.lock.hcl file that terraform init writes to record the exact provider versions chosen and their checksums.
- provider plugin cache — An optional shared folder where Terraform keeps downloaded providers so several projects on one machine can reuse them.
- .gitignore — A text file of patterns naming untracked files Git should not report or add, such as build output and logs.
Taught in
- Providers And The required_providers Block — Infrastructure as Code with Terraform
- Initialising The Working Directory — Infrastructure as Code with Terraform
- Providers: How Terraform Reaches Every API — HashiCorp Terraform Associate (004) Exam Prep
- Versions, The Lock File And Provider Aliases — HashiCorp Terraform Associate (004) Exam Prep
- State: Terraform's Memory Of What It Built — HashiCorp Terraform Associate (004) Exam Prep
- Write, Plan, Apply, And What Init Prepares — HashiCorp Terraform Associate (004) Exam Prep
- Where Modules Come From — HashiCorp Terraform Associate (004) Exam Prep
- Module Versions: Pin, Upgrade, Re-Initialise — HashiCorp Terraform Associate (004) Exam Prep
- The Local Backend, And Workspaces On One Machine — HashiCorp Terraform Associate (004) Exam Prep
- The Full Mock: Sixty Minutes, Eight Areas, One Plan For The Last Week — HashiCorp Terraform Associate (004) Exam Prep