-
Notifications
You must be signed in to change notification settings - Fork 159
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
terraform validate pre-commit hook fails for modules #42
Comments
Could you share the error you're getting? AFAIK, |
Got the same issue here
|
I forked and added |
@thibault-ketterer Ran into this same issue myself this morning, and it seems it's an issue with the provider (see hashicorp/terraform-provider-aws#9989) You can workaround it by either adding a provider config:
OR by setting a default region in the execution environment:
|
thanks I'll check that |
I know this has been open for a while, but rather than create a new issue, I thought I'd use it. I have a modules folder that contains a few modules, one of which uses multiple providers. Because of this, validate cannot be run on this particular module. I'm not great with bash and I am new to pre-commit, so I was hoping for a little help. Can you add a way to exclude a "modules" folder or pass an exclusion when the hook is called? |
You could exclude like this:
|
I created #114 to describe a similar issue |
Dear Team,
I think your pre-commit-collection is really great. I would like to use also the terraform validate pre-commit hook and this fails for plain vanilla terraform modules (without terragrunt), because e.g. arguments are not set (because it is a module).
Could we suppress tf validate if it is a module, meaning no backend definition is there or no provider is present?
The text was updated successfully, but these errors were encountered: