A pluggable Terraform Linter.

679

Language / Framework: Terraform
Checks: 1
Categories: Style

The TFLint plugin provides style analysis for your Terraform code.

Enable the Plugin

To enable TFLint analysis for your project, add the following to your .codeclimate.yml configuration file:

plugins:
  tflint:
    enabled: true

More information about the CLI is available in the README here: https://github.com/codeclimate/codeclimate

Configure the Plugin

By default, TFLint will look for a .tflint.hcl file in the root of
your project. Optionally configure Code Climate to look at a different path:

plugins:
  tflint:
    enabled: true
    config:
      config: optional/path/to/.tflint.hcl

In the same way you can set all the options supported by TFLint (more details here):

plugins:
  tflint:
    enabled: true
    config:
      config: "" # --config=FILE
      ignore_module: [ # --ignore-module=SOURCE
        "..."
      ]
      enable_rule: [ # --enable-rule=RULE_NAME
        "..."
      ]
      disable_rule: [ # --disable-rule=RULE_NAME
        "..."
      ]
      only: [ # --only=RULE_NAME
        "..."
      ]
      enable_plugin: [ # --enable-plugin=PLUGIN_NAME
        "..."
      ]
      var_file: "" # --var-file=FILE
      var: [ # --var='foo=bar'
        "..."
      ]
      module: true # --module

🚧

TFLint does not check modules recursively (source). This means that this plugin will only return issues find in files/folders at root level.

Understand the Plugin

For help with TFLint, check out their documentation.

If you're running into a Code Climate issue, first look over this project's GitHub Issues, as your question may have already been covered. If not, go ahead and open a support ticket with us.