Advice around pre-seeding plugin cache
Attempting to leverage Terraform plugin caching in our Terragrunt environment and running into race conditions with concurrency. I saw a few workarounds in https://github.com/gruntwork-io/terragrunt/issues/1212 but was wondering if there are other ways around the problem as that issue is nearly a year old and I’m not sure if there have been any new features that could help. I’m thinking maybe an error_hook and/or some kind of retry but could use some other ideas. --- <ins datetime="2022-06-01T02:34:02Z"> <p><a href="https://support.gruntwork.io/hc/requests/108687">Tracked in ticket #108687</a></p> </ins>
If anyone else runs across this we were able to get the configuration working in newer Terragrunt versions (v0.36.12+). ``` terraform { extra_arguments "cache" { commands = [ "init", "apply", "refresh", "import", "plan", "taint", "untaint", "show" ] env_vars = { TF_PLUGIN_CACHE_DIR = "/tmp/plugins" } } error_hook "mirror_providers" { commands = ["init", "plan"] execute = ["terragrunt", "providers", "mirror", "/tmp/plugins"] on_errors = [ "Required plugins are not installed", ] } } retryable_errors = [ "Required plugins are not installed", ] retry_max_attempts = 3 retry_sleep_interval_sec = 10 ... } ```