Skip to content


FYI, Terraform can waste a lot of space

I recently +/- ran out of space on my work PC (hurray for tiny SSDs in 2022), and since low space has been a recurrent issue for a while now, I decided to clean a bit more thoroughly than usual, so as to (hopefully) be done with it for a while.
I looked for a disk space analyzer and eventually picked JDiskReport because the UI seemed decent and I liked the “drawback” that it doesn’t have a feature to delete files itself. Eventually, as I was cleaning and spotting space wastes, I stumbled upon our Terraform repo.

I had never noticed this, but Terraform appears to keep all previously used versions of its providers, in every project. So I had 6 old AWS providers in a project (in .terraform\providers\registry.terraform.io\hashicorp\aws, and a bunch of other old versions in another project (in the same folder plus also in what appears to be former folders, which were never deleted, .terraform\plugins\registry.terraform.io\-\aws and .terraform\plugins\registry.terraform.io\hashicorp\aws).
In total, that was around 1GB of crap per project. Not that much, but considering a Terraform repo is fairly below 1MB (even including the fat state files), it’s a “mere” 1000x space waste. It’s crazy how so many dev tools have no consideration at all for the developers’ hardware (and even crazier how so few developers seem to be upset by this kind of crap – if even those people don’t care, who will?).
While I’m at it, a little thought for Rust and its 10 GB of “temporary” files (that are never removed until you delete them yourself and are okay with recompiling from scratch later) in one of our 20 MB (final compiled size) projects…

Posted in programming, software.


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.

Sorry about the CAPTCHA that requires JS. If you really don't want to enable JS and still want to comment, you can send me your comment via e-mail and I'll post it for you.

Please solve the CAPTCHA below in order to fight spamWordPress CAPTCHA