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
Support tflint modules with differing module dependencies #534
Comments
You can do next as a workaround (because - id: terraform_validate
args:
- --hook-config=--retry-once-with-cleanup=true
# - --tf-init-args=-upgrade
- id: terraform_tflint
args:
- --args=--config=__GIT_WORKING_DIR__/.tflint.hcl Also, because |
Thanks @MaxymVlasov - I appreciate the workaround. It is fairly slow to re-init Terraform each tune, as you say, especially when multiple modules and configurations are changing in a given commit, but workable for small changes. |
Side note: |
What should be done:
|
Not sure if anyone is aware, but TFLint 0.50.0 has some specific changes relating to the handling of modules and has marked that change as a BC (but is documented more like a deprecation notice). https://github.com/terraform-linters/tflint/releases/tag/v0.50.0 Hopefully, the work undertaken there can be integrated/supported by pre-commit-terraform. |
What problem are you facing?
In my configuration, I have a number of different modules in the same repo but each module has differing dependencies (either local or published). At present, I'm linting by running
cd {dir} && terraform get && tflint
for each module directory to ensure all dependencies are available and installed. When trying to use theterraform_tflint
hook, it fails for modules with dependencies.How could pre-commit-terraform help solve your problem?
Have the ability to automatically invoke
terraform get
per-directory when running thetflint
hook, either by default or with a flag. Whilstterraform get
is a noop when nothing needs to be done, it still takes time to be invoked so an opt-in hook flag may be the better option.Happy to help craft a PR if this is something that could be incorporated.
The text was updated successfully, but these errors were encountered: