terraform-linters / tflint

A Pluggable Terraform Linter
Mozilla Public License 2.0
4.96k stars 357 forks source link

rule: require `module` blocks to specify `version` #1176

Closed andormarkus closed 3 years ago

andormarkus commented 3 years ago

Hi Community,

In the current version, tflint does not have rule check is module version pinned. Alternatively, you can use terraform_module_pinned_source however, that does not work together with modules from Terraform registry.

Thanks for considering this feature.

Best, Andor

bendrucker commented 3 years ago

Yep, I've thought of this and I guess just forgot to introduce it. Pretty important as registries, public or private, become the dominant way of loading modules. Not sure I'm loading any modules loaded via git at this point.

I'm inclined to add this as a new terraform_module_version rule. I don't particularly like "pinned" since that's not used anywhere in Terraform's own documentation.

andormarkus commented 3 years ago

What's your opinion on terraform_helm_release_version rule as well? I know, we are in minority of the companies who fully configures their Kubernetes cluster with terraform.

bendrucker commented 3 years ago

Oh yeah, wasn't sure whether that was related or just a mis-copy. That sounds totally reasonable, it just belongs in tflint-ruleset-helm (which doesn't exist) rather than the core Terraform rules. I'm also using the Helm provider pretty extensively and would happily use this rule.

Will tackle the module change relatively soon, will take a bit longer to get around to a Helm plugin.

andormarkus commented 3 years ago

Sweet, thank you