Feature Request: Ignore paths when creating hosted artifact
I have many modules which are relatively small in terms of raw terraform
code, but have documentation and tests included which are often multiple times the content.
It would be great if terrareg
had something like the .gitignore
file (possibly .tfmodignore
or just .tfignore
) which would exclude some portion of the module's contents from the generated artifacts when hosting them rather than using a git url.
For example, consider the following simplified illustration:
> tree -a my-module
my-module
├── CHANGELOG.md
├── data.tf
├── docs
│ ├── advanced_usage.md
│ ├── basic_usage.md
│ └── images
│ └── overview.svg
├── examples
│ └── defaults
│ └── main.tf
├── .git # truncated for brevity
├── .gitignore
├── main.tf
├── modules
│ └── sub
│ └── main.tf
├── _module_version_.tf
├── outputs.tf
├── README.md
├── terratests
│ ├── basics_test.go
│ ├── go.mod
│ └── go.sum
├── tests
│ ├── 00_input_validation.tftest.hcl
│ └── 05_basics.tftest.hcl
├── .tfignore
├── variables.tf
└── versions.tf
The only portion that must be served to terraform are these:
> tree -a my-module
my-module
├── data.tf
├── main.tf
├── modules
│ └── sub
│ └── main.tf
├── _module_version_.tf
├── outputs.tf
├── variables.tf
└── versions.tf
So, if I could create a .tfignore
file which follows the same rules as .gitignore
, then I could include this to achieve the desired results:
my-module/.tfignore:
README.md
CHANGELOG.md
.git
.gitignore
docs/
examples/
terratests/
tests/
And I guess it would make sense for it to automatically ignore itself, but I wouldn't object to having to make that explicit.
Github reference: https://github.com/MatthewJohn/terrareg/issues/83