gruntwork-io / terragrunt

Terragrunt is a flexible orchestration tool that allows Infrastructure as Code written in OpenTofu/Terraform to scale.
https://terragrunt.gruntwork.io/
MIT License
8.06k stars 978 forks source link

Ignore hidden folders when running terragrunt hclfmt or at least provide an option to ignore paths #2895

Closed yosefrow closed 1 month ago

yosefrow commented 9 months ago

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:

  1. Using .history folders which store many incomplete versions of terragrunt.hcl files that should not be evaluated
  2. Storing temporary backups of files in .bak folders
  3. Compatibility with any tool that needs to cache or backup terragrunt files in a hidden dir

Describe alternatives you've considered

  1. 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
  2. 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.

cmeury commented 7 months ago

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.

github-actions[bot] commented 2 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for raising this issue.

cmeury commented 1 month ago

Recreated issue: #3391