provider plugin cache
An optional shared folder where Terraform keeps downloaded providers so several projects on one machine can reuse them.
In more detail
Without it, each configuration downloads its own copy of every provider into its .terraform directory. You turn it on with the TF_PLUGIN_CACHE_DIR environment variable or the plugin_cache_dir setting. A pipeline starts with an empty cache, which is one reason it can behave differently from your laptop.
Example
export TF_PLUGIN_CACHE_DIR="$HOME/.terraform.d/plugin-cache"Related terms
- .terraform directory — The hidden folder terraform init creates beside your configuration, holding downloaded providers, fetched modules and backend settings.
- terraform init — The command that prepares a directory for Terraform: it downloads providers, fetches modules, connects the backend and writes the lock file.
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