# Terraform module disk usage

**URL:** <https://discuss.hashicorp.com/t/terraform-module-disk-usage/41727>\
**Category:** Terraform\
**Created:** [July 7, 2022, 7:26pm UTC](https://discuss.hashicorp.com/t/terraform-module-disk-usage/41727 "2022-07-07T19:26:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ambadiaravind](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/ambadiaravind/32/24020_2.png) [@ambadiaravind](https://discuss.hashicorp.com/u/ambadiaravind)\
**Post date:** [July 7, 2022, 7:26pm UTC](https://discuss.hashicorp.com/t/terraform-module-disk-usage/41727/1 "2022-07-07T19:26:08Z")

</div>

Hi All,

How do we prevent terraform from downloading the same repo data multiple times to the local module folder?

module “test1” {  
source = “[git@test.com](mailto:git@test.com):aravind/terraform.git//test1”  
}

module “test2” {  
source = “[git@test.com](mailto:git@test.com):aravind/terraform.git//test2”  
}

The above configuration is downloading the entire repo two times instead of the module sub directory. This causes a lot of disk space usage when you have multiple modules using same source repo

Regards,  
Aravind M D

---

<div class="post-metadata">

**Author:** ![apparentlymart](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/apparentlymart/32/702_2.png) [@apparentlymart](https://discuss.hashicorp.com/u/apparentlymart)\
**Post date:** [July 8, 2022, 2:07am UTC](https://discuss.hashicorp.com/t/terraform-module-disk-usage/41727/2 "2022-07-08T02:07:26Z")

</div>

Hi @ambadiaravind,

Terraform must create a separate directory for each call because sometimes modules modify their own directories during execution, such as when using resources like `local_file` from the `hashicorp/local` provider.

There is no way to avoid those copies. Instead, you could try one of the following:

- Separate your modules into a number of smaller repositories, so that each module package is smaller.
- Place the module that contains these `module` blocks in the same repository as the modules it is calling and then refer to those modules using relative local paths instead, like `source = "../test2"`. Terraform treats local paths as special and will just use the directory already on your local disk, instead of downloading anything new.
