TFLint inspects Terraform code through plugins that flag errors, deprecations, and style issues for major cloud providers and core language rules.
Overview
TFLint acts as a framework where rule packs ship as plugins. The bundled Terraform language ruleset warns about deprecated syntax and unused declarations, while separate plugins add AWS, Azure, and GCP checks such as invalid instance types.
Users enable plugins in .tflint.hcl, run tflint --init to fetch dependencies, and scan modules from the current directory or specified paths. Containers, Homebrew, WinGet, Go installs, and a GitHub Action wrapper are supported distribution options.
Custom organizations can publish plugins discoverable via the tflint-ruleset topic or author Rego policies through the OPA ruleset. Debug logging is available with TFLINT_LOG for troubleshooting rule execution.
Key features
- Plugin-based rule architecture
- Bundled Terraform language ruleset
- AWS, Azure, and GCP provider plugins
- Deprecated syntax and unused checks
- Docker image and GitHub Action
- tflint --init plugin downloader
- Custom plugin and Rego extension paths
- Configurable presets in .tflint.hcl
Use cases
- Catching invalid cloud resource settings
- Enforcing Terraform naming conventions
- Adding lint steps to CI pipelines
- Auditing modules before apply