cfn-lint - Man Page

cfn-lint – CloudFormation Linter


cfn-lint [OPTION...] [TEMPLATE]


-h,  --help

Show a help message and exit



The CloudFormation template to be linted


The CloudFormation template to be linted

-b, --ignore-bad-template

Ignore failures with Bad template


Ignore templates

-f {quiet,parseable,json,junit,pretty,sarif}, --format {quiet,parseable,json,junit,pretty,sarif}

Output Format

-l, --list-rules

list all the rules

-r REGIONS [REGIONS ...], --regions REGIONS [REGIONS ...]

list the regions to validate against.


only check rules whose id do not match these values -c INCLUDE_CHECKS [INCLUDE_CHECKS ...], --include-checks INCLUDE_CHECKS [INCLUDE_CHECKS ...] include rules whose id match these values -m MANDATORY_CHECKS [MANDATORY_CHECKS ...], --mandatory-checks MANDATORY_CHECKS [MANDATORY_CHECKS ...] always check rules whose id match these values, regardless of template exclusions

-e, --include-experimental

Include experimental rules


Provide configuration for a rule. Format RuleId:key=value.


--config-file CONFIG_FILE

Specify the cfnlintrc file to use

-z CUSTOM_RULES, --custom-rules CUSTOM_RULES

Allows specification of a custom rule file.

-v, --version

Version of cfn-lint(1)

--output-file OUTPUT_FILE

Writes the output to the specified file, ideal for producing reports


Merges lists between configuration layers

Advanced / Debugging

-D,  --debug

Enable debug logging

-I,  --info

Enable information logging


specify one or more rules directories using one or more --append-rules arguments.


A CloudFormation Spec override file that allows customization

-g,  --build-graph

Creates a file in the same directory as the template that models the template’s resources in dot(1) format


one or more directories of CloudFormation Registry Schemas

-u,  --update-specs

Update the CloudFormation Specs


cfn-lint test.yaml
Ignore a rule:
cfn-lint -i E3012 -- test.yaml
Configure a rule:
cfn-lint -x E3012:strict=false -t test.yaml
Lint all yaml files in a folder:
cfn-lint dir/**/*.yaml

See Also



December 2021