terragrunt icon indicating copy to clipboard operation
terragrunt copied to clipboard

Add information about Terraform provider plugin caching

Open dataviruset opened this issue 1 year ago • 1 comments

Background On every Terragrunt plan/apply, it will download the provider plugins over and over again (not sure if this is a bug in itself), consuming several hundred megabytes on every Terragrunt run, but after enabling the plugin_cache_dir it stops doing so.

Suggested solution In the caching section of the website I think there should be a page where people are reminded to configure Terraform's provider plugin caching. Specifically to create a plugin_cache_dir and add it to ~/.terraformrc as it's very useful when working with multiple Terragrunt folders that depend on each other and have some shared dependencies like the AWS provider plugin.

dataviruset avatar Jan 16 '24 14:01 dataviruset

I've been using this feature for several months now, and I can confirm that it has several advantages.

Above all, it improves execution speed for massive actions, such as plan/apply on several modules!

I proposed a PR to add a section in the documentation ;)

jcolfej avatar Jan 24 '24 15:01 jcolfej

Unfortunately, this will not work properly with run-all commands, Why Terraform’s built-in provider caching doesn’t work.

lev-ok avatar Apr 19 '24 08:04 lev-ok

Seems Terragrunt has implemented its own provider caching! 🎉 #3001 I'm gonna try it out.

It also means this issue is a duplicate of #2920.

dataviruset avatar Apr 19 '24 10:04 dataviruset

Yes indeed. Please try out Terragrunt's new provider caching feature: https://terragrunt.gruntwork.io/docs/features/provider-cache/.

There is more work to do, but that's captured in https://github.com/gruntwork-io/terragrunt/issues/2920, so closing in favor of that issue.

brikis98 avatar Apr 22 '24 15:04 brikis98