Feature Request: Update Module Version Archive to Include Only Specified Path Contents
Hey,
I've noticed that currently when specifying a git path for creating a module, the archive generated includes the entire repository's contents, not just the specified path.
Current Behavior
When specifying a git path for a module, the archive created by Terrareg contains the whole repository's contents. For example, with repo Structure:
.
├── Dockerfile
├── README.md
└── my-module
├── main.tf
If the specified git path is /my-module
, Terrareg currently generates an archive reflecting the entire folder structure as shown above.
Proposed Change
Update the module version archive creation process to only include the contents of the specified path. For example if the specified git path is /my-module
, the archive would contain:
└── my-module
├── main.tf
Benefits
- Less Storage Capacity Used: The archive now contains only the necessary parts of the module
- Faster Downloads: Faster Module Downloads
- Cheaper Cloud Storage Costs: Lower Storage = less costs
- Privacy Concerns: Sometimes we don't want to share all the contents of our repo
-
Easier for Debug modules: It would be easier for a Dev working locally to debug the contents of the module being used
.terraform
folder as there is less clutter within the files.
Github reference: https://github.com/MatthewJohn/terrareg/issues/41