Freedom251 › Infrastructure Testing Tools
cfn-lint

What cfn-lint is
cfn-lint is a free tool for validating AWS CloudFormation templates written in YAML or JSON. It checks templates against resource provider schemas and applies additional validations, including checks for valid property values and best practices. AWS Serverless Application Model templates can be processed by transforming them with AWS SAM first. The linter runs defined checks and allows custom rules; configuration can come from command-line options, configuration files, or CloudFormation template metadata. Output formats include quiet, parseable, JSON, JUnit, pretty, and SARIF. The project documents installation through pip, Homebrew for macOS, or Docker, and supports Python versions 3.10 through 3.14. Listed integrations include Atom, Emacs, NeoVim/Vim, Sublime, Visual Studio Code, and IntelliJ IDEA, along with a GitHub Action and pre-commit hook. The project describes complex template value validation as best effort: it does not fail merely because it cannot understand or translate a value. The repository identifies the license as MIT No Attribution.
Who it suits
cfn-lint suits developers and teams validating AWS CloudFormation templates, including AWS SAM templates. Its custom rules and CI/CD integrations may fit teams with established validation workflows.
What it does well
- Validates CloudFormation YAML and JSON templates.
- Supports AWS SAM templates.
- Allows user-defined rules and configurable checks.
- Offers JSON, JUnit, pretty, and SARIF output.
- Integrates with editors, GitHub Actions, and pre-commit.
What to know first
- Complex template values are validated on a best-effort basis.
- Supports Python 3.10 through 3.14.
- The listed IaC support centers on CloudFormation and AWS SAM.
Limits
Complex template value checks are best effort, and the tool does not fail only because it cannot interpret or translate a value. The listed capabilities exclude runtime enforcement, provisioning tests, and deployed checks.
Plans
| Plan | Billed and limits | Price |
|---|---|---|
| cfn-lint | MIT-0 licensed · Python 3.10–3.14 supported | Free |
As github.com lists them, read 2 Oct 2026. The maker's own page has the final word.
Getting started
- Install cfn-lint with pip, Homebrew on macOS, or Docker.
- Use Python 3.10 through 3.14 when installing through a Python environment.
- Run it against AWS CloudFormation YAML or JSON templates.
- Configure checks with command-line options, a configuration file, or template metadata.
- Choose an output format or use a listed editor integration, GitHub Action, or pre-commit hook.
cfn-lint is a free validator for AWS CloudFormation templates and AWS SAM. It is a strong fit for teams that want configurable checks before deployment, but it is not a substitute for testing deployed infrastructure.
Overview
The linter checks CloudFormation YAML and JSON against resource provider schemas, valid property values, and best-practice rules. That focused scope makes it useful for catching template issues in development and CI/CD workflows. Its validation of complex values is best effort: it does not fail merely because it cannot interpret or translate one, so a clean result is not proof that every expression has been evaluated.
For AWS infrastructure work, cfn-lint also supports policy as code, policy testing, policy reporting, and configuration compliance. Its declared scope does not include provisioning tests, checks against deployed resources, or runtime enforcement.
Key features
- Rule-based checks: Built-in rules cover specific validations, and custom rules let teams express their own standards. That flexibility helps tailor checks, though teams must define and maintain any organization-specific rules themselves.
- Configuration choices: Command-line options, configuration files, and CloudFormation template metadata provide several ways to control behavior, suiting both one-off use and repeatable workflows.
- AWS SAM support: SAM templates are transformed with AWS SAM before processing, extending the linter beyond plain CloudFormation templates.
- Multiple outputs and integrations: Quiet, parseable, JSON, JUnit, pretty, and SARIF outputs support different reporting workflows. Editor integrations cover Atom, Emacs, NeoVim/Vim, Sublime, Visual Studio Code, and IntelliJ IDEA; a GitHub Action and pre-commit hook help bring checks into routine development.
- Installation and runtime: Installation is documented through pip, Homebrew on macOS, or Docker. Python 3.10 through 3.14 are supported.
Pricing
cfn-lint is free: its plan costs nothing. The project identifies the repository license as MIT No Attribution, allowing use, copying, modification, distribution, sublicensing, and sale without restriction. There is no paid tier to trade off against the free plan, making it suitable for individual developers and teams that need template validation without a software charge.
Platforms
cfn-lint supports Linux, macOS, Windows, and self-hosted use. The documented pip, Homebrew, and Docker installation routes give teams options for developer machines and controlled environments.
Who it's for
Choose cfn-lint if your work centers on AWS CloudFormation or SAM templates and you want schema- and rule-based checks that can be configured and incorporated into editor, pre-commit, or CI/CD workflows. Look elsewhere if the requirement is to test provisioning outcomes, inspect deployed resources, or enforce policies at runtime; those are outside its stated capabilities.
Pros and cons
- Pro: Custom rules and several configuration mechanisms let teams adapt validation to their standards.
- Pro: Multiple structured and human-readable output formats, plus editor and CI integrations, make it practical to fit checks into existing workflows.
- Pro: The free plan and permissive license remove a software purchase barrier for teams that want to use or adapt the tool.
- Con: Complex values receive best-effort validation, so findings cannot establish that every template expression is understood.
- Con: Its template-focused scope leaves provisioning tests, deployed checks, and runtime enforcement to other tools or processes.
Alternatives
AWS CloudFormation is the direct choice for readers seeking AWS's CloudFormation service rather than a separate template linter; the service itself is free, while underlying AWS resources are billed at their own rates.
Conftest is another free, cross-platform option for readers comparing open-source policy testing tools.
Chef InSpec may suit readers looking for a freemium option with a free trial and support across API, Linux, macOS, self-hosted, and Windows environments.
Cinc Auditor is a free alternative for readers considering a free distribution of Chef InSpec, with no formal warranties or support.
KICS is a free option for readers comparing infrastructure policy-as-code tools across Linux, macOS, self-hosted, and Windows.
kubeconform is a free alternative for readers whose selection criteria include Linux, macOS, self-hosted, and Windows support.
OpenSCAP is a free, open-source option for readers evaluating tools under the OpenSCAP umbrella.
Serverspec is a free open-source Ruby gem for readers considering a Ruby-based alternative.
Browse Infrastructure Testing Tools or Infrastructure Policy as Code Tools for more options in those categories.
Verdict
cfn-lint is the right choice for AWS-focused teams that need free, configurable validation of CloudFormation and SAM templates with useful editor and CI/CD integration. Choose it for early template checks; look elsewhere or add complementary tooling when you need proof from provisioning, checks on deployed infrastructure, or runtime enforcement.
Verdict
cfn-lint provides configurable checks and multiple output formats for CloudFormation template validation. Its best-effort handling of complex values is worth bearing in mind when interpreting results.
Questions
Does cfn-lint have a free plan?
Yes. It is free and open source, and the listed plan costs nothing.
What templates does it validate?
It validates AWS CloudFormation YAML and JSON templates and supports AWS SAM templates by transforming them with AWS SAM before processing.
Which output formats are supported?
Supported formats include quiet, parseable, JSON, JUnit, pretty, and SARIF.
How can I install it?
The project documents installation with pip, Homebrew for macOS, or Docker. It supports Python 3.10 through 3.14.
Which integrations are listed?
Editor integrations include Atom, Emacs, NeoVim/Vim, Sublime, Visual Studio Code, and IntelliJ IDEA. The project also lists a GitHub Action and a pre-commit hook.
What license does cfn-lint use?
The repository identifies the license as MIT No Attribution, permitting use, copying, modification, distribution, sublicensing, and sale without restriction.
Facts from cfn-lint's own pages
- Configuration
- Users can configure cfn-lint with command-line options, configuration files, and CloudFormation template metadata. · github.com, 2 Oct 2026
- Installation
- The project documents installation with pip, Homebrew for macOS, or Docker. · github.com, 2 Oct 2026
- Integrations
- The project lists editor integrations for Atom, Emacs, NeoVim/Vim, Sublime, Visual Studio Code, and IntelliJ IDEA, plus a GitHub Action and pre-commit hook. · github.com, 2 Oct 2026
- License
- The repository identifies its license as MIT No Attribution, which grants use, copying, modification, distribution, sublicensing, and sale without restriction. · github.com, 2 Oct 2026
- Output
- Supported output formats include quiet, parseable, JSON, JUnit, pretty, and SARIF. · github.com, 2 Oct 2026
- Purpose
- cfn-lint validates AWS CloudFormation YAML and JSON templates against resource provider schemas and additional checks, including valid property values and best practices. · github.com, 2 Oct 2026
- Rules
- The linter processes rules for specific checks and validations, and supports user-defined custom rules. · github.com, 2 Oct 2026
- Runtime
- The project states that Python 3.10 through 3.14 are supported. · github.com, 2 Oct 2026
- SAM support
- The linter supports AWS Serverless Application Model templates by transforming them with AWS SAM before processing. · github.com, 2 Oct 2026
- Support
- The project invites users to join its Discord community to discuss cfn-lint and get help. · github.com, 2 Oct 2026
- Validation caveat
- The project describes validation of complex template values as best effort and says it will not fail just because it cannot understand or translate them. · github.com, 2 Oct 2026
- Who it serves
- The project describes cfn-lint as a tool for validating AWS CloudFormation templates. · github.com, 2 Oct 2026
Where cfn-lint stands on Freedom251
- Infrastructure Testing Tools#5 of 28