TFLint
$ tflint Community Low Risktflint goes beyond terraform validate by linting HCL against cloud provider-specific rulesets (AWS, Azure, GCP) and Terraform naming/type conventions. It runs non-interactively, supports --recursive multi-module scans, and emits clean JSON diagnostics via --format json.
brew install tflint Local HCL static linter with --format json; direct CLI execution beats MCP indirection.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports --format json, --format sarif, --format compact, --no-color, and --recursive with clear exit codes.
- Native
--format jsonand--no-colorflags - Headless
--recursivedirectory traversal
Read-only static analysis by default; local writes occur only for --init plugin caching or explicit --fix.
- Zero cloud credentials required; read-only default mode
Single static Go binary for macOS, Linux, and Windows via Homebrew, Chocolatey, Docker, and GitHub Releases.
- Single static Go binary with cross-platform packages
Catches invalid instance types, deprecated syntax, and unused declarations before terraform plan.
- Pluggable AWS/Azure/GCP rulesets catch provider-level errors offline
Widely adopted community-maintained tool (terraform-linters/tflint) under MPL-2.0.
- Active
terraform-linters/tflintrepo under MPL-2.0
Well-documented user guide, rule catalog, and .tflint.hcl configuration reference.
- Detailed user guide and rule docs in repository
Security, Auth & Guardrails
Core linting requires no auth; tflint --init honors GITHUB_TOKEN to avoid rate limits when downloading provider plugins.
MPL-2.0 open-source and free.
# TFLint Agent Rules - Always pass `--format json` or `--format compact --no-color`. - Run `tflint --init` once if `.tflint.hcl` declares external plugins. - Do not pass `--fix` without reviewing `git diff` afterward.
Agent-Ready Command Recipes
Safe Read-Only Queries
tflint --recursive --format json
Scans the root and all child directories, emitting structured JSON issues and errors.
tflint --no-color --format compact
Outputs concise file:line:col: message lines when minimal token output is preferred.
Controlled Writes & Previews
tflint --init
Downloads plugins declared in .tflint.hcl into the local ~/.tflint.d/plugins cache.
Strengths for Agents
- + Clean
--format jsonand--format compactoutputs with--no-color. - + Catches provider-specific errors (like invalid EC2 types) locally before
plan. - + Supports
--recursivescanning across monorepos.
Caveats & Pitfalls
- ! Provider-specific checks require running
tflint --initwith network access first. - ! Complex dynamic HCL expressions can sometimes trigger false positives without config tuning.