-
-
Notifications
You must be signed in to change notification settings - Fork 540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
terragrunt_validate - fails for folders without terragrunt.hcl #191
Comments
@antonbabenko - any chance of a review/merge with this? I'm hitting this on a regular basis which means I keep running with |
This issue has been automatically marked as stale because it has been open 30 days |
pre-commit-terraform/.pre-commit-hooks.yaml Lines 80 to 86 in ac9299c
I have no setup with terragrunt right now, to check if it works or not now. repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.62.3
hooks:
- id: terragrunt_validate Also, if you will use different settings, please share them here |
…tories (antonbabenko#191) The command fails if there is no terragrunt.hcl file in the directory.
I ran into this same problem with a similar setup. The issue is that So either the hook needs to only run in directories with But now I'm wondering if this hook is actually doing what it's meant to. The description says "Validates all Terragrunt configuration files.", but really it's validating Terraform through the Terragrunt wrapper. I am not sure what people are using it for, but personally I think the description should be updated. |
I think, you mean We can't disable possibility to check terragrunt files with different name than https://terragrunt.gruntwork.io/docs/reference/cli-options/#terragrunt-config Maybe we can introduce |
This issue has been automatically marked as stale because it has been open 30 days |
I'm seeing this as well. There are plenty of use cases where files change but terragrunt_validate should not run because there's no terragrunt.hcl but it runs anyways since there are other .hcl files. |
@mijdavis2 you can redefine As I wrote in prev message, |
And please provide more details about your file structure and file naming, and for which propose you use .hcl files |
I have a similar folder structure in the |
Suppose a multi-tier project (dev,stage, prod, etc) where not every folder contains a terragrunt.hcl. Non-module folders will only contain hcl files with some "local" definitions which get inherited from the module folders, e.g.
In this setup, terragrunt_validate will fail in folders where it can't find a terragrunt.hcl.
Proposed solution:
Only run
terragrunt validate
in folders, which contain a terragrunt.hclThe text was updated successfully, but these errors were encountered: