typed-variables
What it does
Section titled “What it does”Reports a variable block with no type argument.
Why it matters
Section titled “Why it matters”Without a type any value is accepted and converted when it is used, so a wrong value (a string where a list was meant) is found late, with an error far from the variable. A type checks the value when it is given and documents what is expected.
To fix, add type.
Example
Section titled “Example”variable "plain" {}
variable "full" { type = string...Configuration
Section titled “Configuration”hcl: lint: rules: typed-variables: warn # off (default), warn, errorEnabled by the presets: hcl/tflint-recommended.
Suppress one line with sudsy-disable-next-line typed-variables in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| tflint | terraform_typed_variables |
full |