How to cache providers in EC2 worker pools
Last updated: September 9, 2025
When running jobs on EC2 worker pools, you can optimize execution times by caching provider binaries. Here are two recommended approaches:
Using the binaries cache volume
Private workers come with a built-in binaries cache volume that automatically stores and reuses provider binaries between runs. This feature is enabled by default and requires no additional configuration.
Environment variable configuration
You can configure provider caching by setting the TF_PLUGIN_CACHE_DIR environment variable. This tells OpenTofu where to store provider binaries locally, reducing download times for subsequent runs.
Advanced optimization
For maximum performance, you can create a custom runner image with pre-installed providers. This eliminates the need to download providers during runtime. See our documentation on custom runner images for more details.
For more information about provider caching in worker pools, visit our worker pools documentation.