Difference between revisions of "Cfn-lint"

From wikieduonline
Jump to navigation Jump to search
 
(21 intermediate revisions by 2 users not shown)
Line 1: Line 1:
* <code>[[pip install]] cfn-lint</code>
+
{{lowercase}}
 +
https://github.com/aws-cloudformation/cfn-lint
  
 +
* Installation: <code>[[pip3 install]] cfn-lint</code>
 +
* Help: <code>[[cfn-lint --help]]</code>
  
+
Examples:
* <code>cfn-lint</code>
+
* <code>[[cfn-lint file_with_your_stack.yml]]</code>
 +
* <code>cfn-lint -t</code>
 
* <code>cfn-lint --version</code>
 
* <code>cfn-lint --version</code>
  
 +
cfn-lint your_file.yml
 +
E0000 Null value at line 1 column 8
 +
your_file.yml:1:8
  
cfn-lint your_stack.yml
 
E0000 mapping values are not allowed in this context
 
your_stack.yml:5:23
 
  
Configuration files:
+
===Configuration files===
 
* <code>[[.cfnlintrc]]</code>
 
* <code>[[.cfnlintrc]]</code>
  
== Help ==
+
== Related ==
<pre>
+
* <code>[[terraform fmt]]</code>
cfn-lint
+
* [[Taskcat]]
usage:
+
* <code>[[cfn-init]]</code>
Basic: cfn-lint test.yaml
+
* <code>[[E1012]] Ref Your_Ref not found as a [[resource]] or [[parameter]]</code>
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
 
 
 
CloudFormation Linter
 
 
 
optional arguments:
 
  -h, --help            show this help message and exit
 
 
 
Standard:
 
  TEMPLATE              The CloudFormation template to be linted
 
  -t TEMPLATE [TEMPLATE ...], --template TEMPLATE [TEMPLATE ...]
 
                        The CloudFormation template to be linted
 
  -b, --ignore-bad-template
 
                        Ignore failures with Bad template
 
  --ignore-templates IGNORE_TEMPLATES [IGNORE_TEMPLATES ...]
 
                        Ignore templates
 
  -f {quiet,parseable,json,junit,pretty}, --format {quiet,parseable,json,junit,pretty}
 
                        Output Format
 
  -l, --list-rules      list all the rules
 
  -r REGIONS [REGIONS ...], --regions REGIONS [REGIONS ...]
 
                        list the regions to validate against.
 
  -i IGNORE_CHECKS [IGNORE_CHECKS ...], --ignore-checks IGNORE_CHECKS [IGNORE_CHECKS ...]
 
                        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
 
  -x CONFIGURE_RULES [CONFIGURE_RULES ...], --configure-rule CONFIGURE_RULES [CONFIGURE_RULES ...]
 
                        Provide configuration for a rule. Format RuleId:key=value. Example: E3012:strict=false
 
  --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
 
  --output-file OUTPUT_FILE
 
                        Writes the output to the specified file, ideal for producing reports
 
  --merge-configs      Merges lists between configuration layers
 
 
 
Advanced / Debugging:
 
  -D, --debug          Enable debug logging
 
  -I, --info            Enable information logging
 
  -a APPEND_RULES [APPEND_RULES ...], --append-rules APPEND_RULES [APPEND_RULES ...]
 
                        specify one or more rules directories using one or more --append-rules arguments.
 
  -o OVERRIDE_SPEC, --override-spec OVERRIDE_SPEC
 
                        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 format
 
  -s REGISTRY_SCHEMAS [REGISTRY_SCHEMAS ...], --registry-schemas REGISTRY_SCHEMAS [REGISTRY_SCHEMAS ...]
 
                        one or more directories of CloudFormation Registry Schemas
 
  -u, --update-specs    Update the CloudFormation Specs
 
</pre>
 
  
 
== See also ==
 
== See also ==
 +
* {{cfn-lint}}
 +
* {{aws cloudformation deploy}}
 
* {{aws cloudformation}}
 
* {{aws cloudformation}}
 +
* {{IDE}}
 
* {{CloudFormation}}
 
* {{CloudFormation}}
  
 
[[Category:CloudFormation]]
 
[[Category:CloudFormation]]

Latest revision as of 09:01, 9 May 2022

Advertising: