terragrunt
terragrunt copied to clipboard
Ignore hidden folders when running terragrunt hclfmt or at least provide an option to ignore paths
Describe the solution you'd like A clear and concise description of what you want to happen.
Ignore hidden folders when running terragrunt hclfmt or at least provide an option to ignore paths.
Use cases:
- Using .history folders which store many incomplete versions of terragrunt.hcl files that should not be evaluated
- Storing temporary backups of files in .bak folders
- Compatibility with any tool that needs to cache or backup terragrunt files in a hidden dir
Describe alternatives you've considered
- bash alias to find all .history folders in terragrunt dir and rm-rf them. This is a brutal workaround and one I prefer to avoid
-
terragrunt hclfmt --terragrunt-exclude-dir '**/.history/*' --terragrunt-exclude-dir '**/.history/**/*' --terragrunt-check
likely does not work because --terragrunt-exclude-dir only works with --run-all
Additional context being able to exclude paths for any terragrunt command including hclfmt seems like common sense to me. I feel I'm missing some obvious solution here. But I couldn't find it on my own.
Also, if you have other *.hcl
files in your repository (for example, for Vault), that are under a different formatting regime, it would be very useful to be able to exclude folders.