Ignore Regex Function while linting #2127
-
I am totally stuck with tflint. It really wants to check that a regex function is working but the value the regex function is checking is coming from a file. It seems tflint isn't checking in that file and therefore has no idea what that value is. Now I keep getting this error:
I discovered this rule is just noise: I can't google the error either. I just have not come up with anyone else having this issue. How can I get tflint to simply ignore the regex function? Can I just ignore the variable somehow and tell TFLINT to not try any rule at all on this variable? The block in question looks like this: locals {
integrations = flatten([
for path, methods in local.body.paths : [
for method, details in methods : {
path = path
method = upper(title(method))
integration = details["x-amazon-apigateway-integration"]
name = regex("function:([^/]+)", details["x-amazon-apigateway-integration"].uri)[0]
}
]
])
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
No, there is no way to bypass evaluating an expression. If you're getting an error, it's because you're passing bad input to
If it were called the same way, this cannot be true. So you're somehow calling the module differently via TFLint, e.g., setting different variables, expecting data sources and then falling back on invalid defaults, etc. |
Beta Was this translation helpful? Give feedback.
No, there is no way to bypass evaluating an expression.
If you're getting an error, it's because you're passing bad input to
regex
. It has nothing to do with that specific rule, beyond the fact that it references this particular invalid expression. If it were unknown input the function would not get evaluated.If it were called the same way, this cannot be true. So you're somehow calling the module differently via TFLint, e.g., setting different variables, expecting data sources and then falling back on invalid defaults, etc.