Replies: 1 comment
-
I can't reproduce this issue, can you provide some reproducible code? $ tflint
2 issue(s) found:
Error: "t2.foo" is an invalid value as instance_type (aws_instance_invalid_type)
on main.tf line 3:
3: instance_type = "t2.foo" # invalid type
Error: "t2.bar" is an invalid value as instance_type (aws_instance_invalid_type)
on main.tf line 8:
8: instance_type = "t2.bar" # invalid type |
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Introduction
TFLint currently reports only the first occurrence of a rule violation in a .tf file, even when multiple resources in the same file violate the same rule.
This makes it difficult to fix all issues efficiently, because developers must run TFLint multiple times to surface subsequent violations.
It would be more helpful if TFLint could report all occurrences of a violation in a file during a single run.
Proposal
Enhance TFLint’s rule execution so that rules can emit multiple diagnostics per file/resource, instead of stopping after the first match.
resource "aws_instance" "bad1" {
ami = "ami-123456"
instance_type = "t2.foo" # invalid type
}
resource "aws_instance" "bad2" {
ami = "ami-123456"
instance_type = "t2.bar" # invalid type
}
Expected behavior:
Both bad1 and bad2 should be reported as separate violations.
Actual behavior:
Only the first (bad1) is reported. The second occurrence is not shown, even with --recursive or --format json.
tflint --version
TFLint version 0.58.1
References
TFLint documentation
tflint-ruleset-aws
Beta Was this translation helpful? Give feedback.
All reactions