terraform-linters / tflint

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

How to create a new custom rule #935

Closed Neekoy closed 3 years ago

Neekoy commented 4 years ago

Heya,

I went through the documentation a couple of times, but it goes over my head at the moment.

I need to create a linting rule, which would check if the variable origin_ssl_protocols contains any of the following entries:

origin_ssl_protocols = ["SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2"]

If it contains any entries different than the above, the linting should fail.

Any help is appreciated, thanks in advance.

wata727 commented 4 years ago

Hi @Neekoy, tflint-ruleset-template will help you create a plugin. Please take a look.