cfn-lint
$ cfn-lint Official Low Riskcfn-lint validates AWS CloudFormation YAML and JSON templates offline against official AWS CloudFormation resource specifications and built-in rules. Its -f json output gives coding agents exact file, line, column, and rule IDs for automated template fixes.
brew install cfn-lint Runs locally in milliseconds with -f json; much faster and zero-token-overhead compared to calling an AWS MCP server.
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 -f json (--format json) and SARIF, exits cleanly with bitmask severity codes, and never prompts interactively.
- Native
-f json/--format jsondiagnostic array - Bitmask exit codes distinguishing errors, warnings, and informational findings
Strictly read-only static analyzer requiring zero AWS credentials or network access during normal linting.
- 100% read-only local execution with zero IAM credentials
Available via Homebrew, pip, and uvx across macOS, Linux, and Windows; requires Python runtime when installed via pip.
- Cross-platform Python package with Homebrew and
uvxsupport
Catches AWS schema, intrinsic function, and region errors locally before slow cloudformation deploy cycles.
- Bundled AWS CloudFormation specs eliminate API round-trips
Official AWS CloudFormation team repository (aws-cloudformation/cfn-lint) under MIT-0 with frequent spec updates.
- Official AWS-maintained repo with MIT-0 license
Extensive rule documentation, schema coverage, and clear --help flags.
- Comprehensive rule index and CLI flags in repo docs
Security, Auth & Guardrails
No AWS credentials required; uses bundled AWS CloudFormation resource schemas locally.
MIT-0 open-source by AWS; completely free and offline.
# cfn-lint Agent Rules - Always pass `-f json` when validating CloudFormation templates for automated parsing. - Use `-r <region>` when templates target regions other than `us-east-1`. - Treat exit code `2` (errors) as blocking; inspect warnings (`4`) per `.cfnlintrc`.
Agent-Ready Command Recipes
Safe Read-Only Queries
cfn-lint template.yaml -f json
Validates the template offline and returns structured JSON diagnostics with line numbers and rule IDs.
cfn-lint 'templates/**/*.yaml' -r us-east-1 us-west-2 -f json
Checks resource availability and property specs against the specified AWS regions.
Strengths for Agents
- + Structured
-f jsonoutput pinpoints file, line, column, rule ID, and remediation message. - + Zero AWS credentials needed; validates templates offline against AWS schemas.
- + Bitmask exit codes let agents distinguish hard errors from warnings.
Caveats & Pitfalls
- ! Python runtime dependency slightly slows cold start compared to static Go binaries.
- ! Custom CloudFormation macros/transforms may require
--ignore-checkstuning.