pantsbuild / pants

The Pants Build System
https://www.pantsbuild.org
Apache License 2.0
3.35k stars 640 forks source link

Allow all file types in `terraform check` goal #21506

Open frekw opened 1 month ago

frekw commented 1 month ago

Describe the bug Currently, the terraform backend only supports *.tf files. There are a lot of situations where other file types are necessary, such as when keeping configuration for some system in a .json or some other format, which is then read by the Terraform module.

I think it would be good to relax this constraint to support any and all filetypes, but keep the default to *.tf as to not have undesired consequences.

Pants version 2.21.0.rc0

OS Linux

Additional info n/a

lilatomic commented 1 month ago

You can use a files or resources target for those types of files, and add that target as a dependency of the terraform_module. Something like:

resources(name="certs", sources=["*.cer", "*.crt"])
terraform_module(dependencies=[":certs"])

This is similar to other backends work, where the SourcesField subclass will pull in only the files that are in that language, and other files are pulled in with resources or files