Skip to main content
Welcome — this lesson shows how to add CFN-Lint to your development workflow so you can validate AWS CloudFormation templates, catch errors early, and follow recommended best practices before deploying stacks. CFN-Lint (a.k.a. cfn-python-lint) analyzes CloudFormation templates (YAML or JSON), detects syntax/semantic issues, and surfaces suggestions directly in your editor when the CLI is installed and accessible.

Add the VS Code extension

  1. Open the Extensions pane in Visual Studio Code (click the Extensions icon in the Activity Bar or use the three dots → Extensions).
  2. Search for cfn-lint.
  3. Install the extension named “CloudFormation Linter” (vscode-cfn-lint).
This extension integrates with the CFN-Lint CLI and shows problems inline in editors and the Problems pane.
A Visual Studio Code extensions pane showing the "CloudFormation Linter" (vscode-cfn-lint) extension selected. The panel displays the extension icon, author, ratings, version/download badges, and Disable/Uninstall buttons.

Open a template to see problems

After installing the extension, open a CloudFormation template. Example YAML:
If the extension detects that the CFN-Lint CLI is not installed or not on your PATH, you may see warnings like:
These messages mean the VS Code extension could not invoke the CFN-Lint CLI. The extension acts as a client — it requires the CLI (a Python package) to be installed locally so it can run checks.
CFN-Lint requires Python 3.8 or later. Ensure Python and pip are installed and available on your PATH. After installing the CLI, restart VS Code so the extension can detect cfn-lint.
On Windows, add Python and your Scripts directory (e.g. C:\Users\<you>\AppData\Local\Programs\Python\Python39\Scripts) to your PATH. On macOS/Linux, verify which python3 and which pip3 (or python3 --version) to confirm availability.

Where to get the CFN-Lint CLI

Official source and documentation: Common installation methods (choose based on your environment): Quick verification after install:

Tips for seamless integration

  • If VS Code still shows CLI not found after installing, restart VS Code or your terminal so the PATH updates take effect.
  • Use cfn-lint --info to display rule metadata and guidance for resolving issues.
  • Add CFN-Lint to CI pipelines (Docker or pip installation) to enforce template quality in PRs.

Next steps in this series

  1. Install Python on your platform (Windows, macOS, or Linux) if you haven’t already.
  2. Install the CFN-Lint CLI using the method that fits your environment.
  3. Restart VS Code and open a CloudFormation template — you should now see inline diagnostics from the extension.
  4. In the next lesson, we’ll configure rule sets, customize ignores, and add CFN-Lint checks to CI workflows.

Watch Video