- Install the VS Code extension for CloudFormation linting.
- Install the cfn-lint CLI (required by the extension).
- Verify linting works from both VS Code and the command line.
- Visual Studio Code
- Python 3.8+ (for the pip install method) or Homebrew / Docker (optional)
- Basic familiarity with CloudFormation templates
- Install the CloudFormation Linter extension in VS Code
- Open Visual Studio Code and go to the Extensions view (use the sidebar icon or the three-dot/grid icon if your sidebar is narrow).
- Search for “CFN-Lint” or “CloudFormation Linter”.
- Install the extension titled “CloudFormation Linter” (vscode-cfn-lint). When prompted, trust and install the publisher.

- Open a template to test the extension Open any CloudFormation template (YAML or JSON) in VS Code. Example minimal YAML:
cfn-lint is not found, that’s expected until you install the cfn-lint CLI. The VS Code extension uses the cfn-lint executable under the hood to perform checks.
- Install the cfn-lint CLI The extension requires the Python-based cfn-lint executable. Below are common installation methods. Use the method that fits your platform and environment.

| Method | Platform | Install command | Notes |
|---|---|---|---|
| pip | Linux / macOS / Windows (Python) | python3 -m pip install cfn-lint | Use extras for full feature set (graph, junit, sarif). |
| Homebrew | macOS | brew install cfn-lint | Simple macOS install; kept up-to-date via brew. |
| Docker / Source | Any (with Docker) | docker build . (from repo) | Useful in environments where installing Python packages is restricted. |
After installing Python and cfn-lint, restart VS Code so the extension can detect the installed cfn-lint executable. If VS Code still cannot find the executable, set the path to the cfn-lint binary in the extension settings or ensure the binary is on your system PATH.
- Run cfn-lint from the command line Once installed, verify the linter from your terminal:
- If the extension does not detect the cfn-lint executable:
- Confirm the CLI runs from your terminal (run
cfn-lint --version). - Ensure the terminal shell used by VS Code has the same PATH as your interactive shell.
- Configure the extension setting for the cfn-lint executable path if necessary.
- Confirm the CLI runs from your terminal (run
- If you need dependency isolation, install cfn-lint in a virtual environment (venv) and point VS Code to that venv’s binary.
- cfn-lint GitHub repository: https://github.com/aws-cloudformation/cfn-lint
- VS Code CloudFormation linter extension: search “vscode-cfn-lint” in the Extensions Marketplace
- AWS CloudFormation docs: https://docs.aws.amazon.com/cloudformation/