Purging old provider & plugin bloat

Hi, my .terraform directories are filling up with several GBs of provider versions and plugins that should not be used anymore. As in >6GB of bloat after about a year of use.

Is there any way to properly dispose of all these old versions? I haven’t been able to find anything useful online or in the documentation…

If you have a .terraform.hcl.lock file which declares which providers are necessary, is there a good reason for not doing a rm -rf .terraform/ ; terraform init periodically?

If you use a local provider cache will all the references in .terraform folders be symlinked to that rather than having multiple copies of the provider everywhere ?

Yeah, turns out rm -rf .terraform/ ; terraform init works fine, but does requires re-authentication for remote state etc. Thanks.

But I don’t get how a hashicorp finds this acceptable tbh. Based on stuff like this, I now avoid anything else from hashicorp with out a second thought. Let alone considering the enterprise products :man_shrugging:

Could you describe a behaviour that you would find acceptable? Perhaps you could give a new perspective…