docs/src/content/docs/03-features/07-caching/03-auto-provider-cache-dir.mdx
This feature has been stabilized and is now enabled by default when using OpenTofu >= 1.10.
Automatic Provider Cache Dir is a feature of Terragrunt that automatically configures OpenTofu's native provider caching mechanism by setting the TF_PLUGIN_CACHE_DIR environment variable. This enables efficient provider caching without the need to manually configure provider cache directories or use Terragrunt's provider cache server.
When using OpenTofu >= 1.10, Terragrunt will automatically configure OpenTofu to use a shared provider cache directory, which provides several benefits:
The Automatic Provider Cache Dir feature has specific requirements:
When using OpenTofu >= 1.10, this feature is enabled by default. No additional configuration is required:
terragrunt run --all apply
When enabled, Terragrunt automatically:
The default provider cache directory is located at:
$HOME/.terragrunt-cache/providers on Unix systems$HOME/Library/Caches/terragrunt/providers on macOS%LocalAppData%\terragrunt\providers on WindowsYou can customize the provider cache directory using the --provider-cache-dir flag:
terragrunt apply --provider-cache-dir /custom/path/to/cache
Or with environment variables:
TG_PROVIDER_CACHE_DIR='/custom/path/to/cache' terragrunt apply
You can disable the feature for specific runs using the --no-auto-provider-cache-dir flag:
terragrunt run --all apply --no-auto-provider-cache-dir
This is particularly useful when:
Terragrunt also provides a Provider Cache Server feature. Here's when to use each:
Use Auto Provider Cache Dir when:
Use Provider Cache Server when:
If the feature doesn't seem to be working:
TF_PLUGIN_CACHE_DIR is not already set by another toolYou can enable debug logging to see more information:
terragrunt apply --log-level debug