Back to Terragrunt

Auto Provider Cache Dir

docs/src/data/experiments/auto-provider-cache-dir.mdx

1.0.31.6 KB
Original Source

Enable native OpenTofu provider caching by setting TF_PLUGIN_CACHE_DIR instead of using Terragrunt's internal provider cache server.

auto-provider-cache-dir - What it does

This experiment automatically configures OpenTofu to use its built-in provider caching mechanism by setting the TF_PLUGIN_CACHE_DIR environment variable. This approach leverages OpenTofu's native provider caching capabilities, which are more robust for concurrent operations in OpenTofu 1.10+.

This experiment flag is no longer needed, as the auto-provider-cache-dir feature is now enabled by default when using OpenTofu >= 1.10.

Requirements:

  • OpenTofu version >= 1.10 is required
  • Only works when using OpenTofu (not Terraform)

Disabling the feature:

You can disable the auto-provider-cache-dir feature using the --no-auto-provider-cache-dir flag:

bash
terragrunt run --all apply --no-auto-provider-cache-dir

auto-provider-cache-dir - How to provide feedback

Now that the auto-provider-cache-dir experiment is complete, please provide feedback in the form of standard GitHub issues.

auto-provider-cache-dir - Criteria for stabilization

To transition the auto-provider-cache-dir feature to stable, the following have been completed:

  • Comprehensive testing to confirm the safety of concurrent runs using the same provider cache directory.
  • Performance comparison with the existing provider cache server approach.
  • Documentation and examples of best practices for usage.
  • Community feedback on real-world usage and any edge cases discovered.