talira

A Pluggable Terraform Linter

source availableMPL-2.0 AND BUSL-1.1self-hostablefree

TFLint is a linter for Terraform code, built as a framework where every rule comes from a plugin: the bundled Terraform ruleset warns about deprecated syntax, unused declarations and naming conventions, and rulesets for AWS, Azure and Google Cloud catch errors such as invalid instance types before terraform plan does. It parses Terraform v1.x with its own fork of Terraform's parser, so Terraform needn't be installed. Most of it is MPL-2.0, but some files are BUSL-1.1, so the release binaries are bound by both.

Ways to install

Problems it solves

  • catch an invalid AWS instance type in our Terraform before apply fails
  • warn about unused variables and deprecated syntax in our Terraform modules
  • enforce naming conventions across our infrastructure code in CI
  • lint Terraform on every pull request with a GitHub Action
  • write our own lint rules for our company's Terraform conventions
  • fail the build when someone uses a resource argument the provider deprecated

Features

  • plugin-based rulesets
  • bundled Terraform ruleset with presets
  • AWS, Azure and Google Cloud rulesets
  • custom plugins installed with tflint --init
  • input variables and tfvars evaluated like Terraform
  • language server
  • GitHub Action (setup-tflint) and Docker image

Capabilities

Has a command line toolplan not known
Takes pluginsplan not known

Alternatives

The same job

These do what TFLint does.

  1. Checkov Prevent cloud misconfigurations and find vulnerabilities during build-time in infrastructure as code, container images and open source packages
  2. tfsec Security scanner for your Terraform code

Compare TFLint with the top 3