tflint does not recognise ".tf" files at the root of the folder #2060
Unanswered
alexpilon666
asked this question in
Q&A
Replies: 1 comment
-
TFLint validates Terraform modules. If you use another tool that takes some other input and turns it into valid Terraform modules, TFLint is inherently not going to handle that. This is not a bug. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
We use Terraspace instead of native Terraform. This gives us the ability to use generic configurations that are made available to all of our stacks, from a single source:
/config/terraform/<file_name>.tf
. In this folder we have acommon.tf
with a bunch oflocals
that have their value generated by Terraspace upon initialization, and then referenced in our various stacks; thoselocals
are ignored bytflint
and instead we have hundreds ofError: Reference to undeclared local value
errors when runningtflint
when executing our pre-commit hooks.I've tried looking at a rule that we could disable for this, but I can't find anything.
I had previously opened an issue when Hashicorp updated their VSCode extension, which started flagging the same thing as errors everywhere. They said we could disable something called "Enhanced Validation", which when we did started working properly, REF: hashicorp/vscode-terraform#1584
But around the same time as the extension starting throwing the errors, we had to disable our
tflint
pre-commit hook because it would always return the above-mentioned hundreds of errors.Command
tflint --config=GIT_WORKING_DIR/.tflint.hcl
Terraform Configuration
TFLint Configuration
Output
TFLint Version
0.50.1
Terraform Version
1.8.4
Operating System
Beta Was this translation helpful? Give feedback.
All reactions