Posted On: Jan 18, 2023

AWS CloudFormation announces support for CloudFormation Linter (cfn-lint) in AWS Serverless Application Model Command Line Interface (AWS SAM CLI). The cfn-lint tool validates your SAM JSON/YAML template against CloudFormation-based rules, and returns diagnostic error messages. With this launch, you can use an optional parameter —lint in sam validate command to run cfn-lint validations on your SAM JSON/YAML templates.

You can use --lint to validate for CloudFormation-based rules. These rules checks for template attributes such as template size, template description limits, Fn::GetAtt parameters, Fn::If syntax structure, and others. For a complete list of default rules, refer to cfn-lint rules guideline.

This feature is available in US East (Ohio and N. Virginia), US West (N. California and Oregon), Africa (Cape Town), Asia Pacific (Hong Kong, Hyderabad, Jakarta, Mumbai, Osaka, Seoul, Singapore, Sydney, and Tokyo), Canada (Central), China (Beijing) operated by Sinnet, and China (Ningxia), operated by NWCD, Europe (Frankfurt, Ireland, London, Milan, Paris, Spain, Stockholm, and Zurich), Middle East (Bahrain, and UAE), South America (São Paulo), and AWS GovCloud (US-East) and (US-West) Regions.

To install the latest version of the SAM CLI refer to the following instructions.