Overview
To improve performance in infrastructure-as-code environments, env zero supports an optional plugin cache. This cache stores previously downloaded provider plugins on a persistent volume, allowing reuse across runs within the same environment. The plugin cache can reduce run times and avoid redundant downloads when enabled. This caching mechanism is opt-in and requires specific environment variables. It is supported only for environments running with a self-hosted Kubernetes agent that uses PVC.Enabling Plugin Cache
To enable the plugin cache, set the following environment variable:ENV0_USE_TF_PLUGIN_CACHE=true
When this variable is set, env zero will use a persistent volume to cache provider plugins used by OpenTofu, Terraform, or Terragrunt. These plugins will then be reused in subsequent runs within the same environment
Wiping the Cache
If you need to wipe the plugin cache before a run (for example, to force re-downloading of providers or resolve potential cache issues), set the following additional environment variable:ENV0_WIPE_TF_PLUGIN_CACHE=true
๐ Note: This variable only takes effect if
ENV0_USE_TF_PLUGIN_CACHE
is also set.Requirements
- Self-Hosted Kubernetes Agent (SHAG)
- Use of Persistent Volume Claims (PVC) for storage
- Applies to environments using OpenTofu, Terraform, or Terragrunt