在部署前使用 cfn-lint 验证 CloudFormation 模板
Catch CloudFormation schema, region, and intrinsic-function mistakes before a stack update fails in review or deployment.
Prerequisites
Python or cfn-lint binary, CloudFormation templates
Installation
Use the upstream install or setup path that matches your environment:
- pip install cfn-lint. If pip is not available, run
- brew install cfn-lint
- docker build --tag cfn-lint:latest .
- docker run --rm -v pwd:/data cfn-lint:latest /data/template.yaml
Requirements and caveats from upstream:
- <img alt="[cfn-lint logo]" src="https://github.com/1991513ccie-png/skills" width="150" align="right">
-
- Python 3.10 to 3.14 are supported.
Basic usage or getting-started notes:
- To get information about the SAM Transformation, run the linter with --info
- ### Pip
- #### Optional dependencies
- Source: https://github.com/1991513ccie-png/skills
- Extracted from upstream docs: https://raw.githubusercontent.com/aws-cloudformation/cfn-lint/HEAD/README.md
Documentation
- https://github.com/1991513ccie-png/skills