cfn-python-lint | CloudFormation Linter | AWS library
kandi X-RAY | cfn-python-lint Summary
kandi X-RAY | cfn-python-lint Summary
Validate AWS CloudFormation yaml/json templates against the AWS CloudFormation Resource Specification and additional checks. Includes checking valid values for resource properties and best practices.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of cfn-python-lint
cfn-python-lint Key Features
cfn-python-lint Examples and Code Snippets
Community Discussions
Trending Discussions on cfn-python-lint
QUESTION
cfn-lint version: 0.53.0
Description of issue.
I have following setup on my Ubuntu machine
- cfn-lint
- cfn-python-lint via pre-commit
Case 1: If I run cfn-lint ./**/*.yml
from terminal at the project root folder then there are no errors
Case 2: If I now try to git commit the code with pre-commit installed, it gives the following error "E0000 Template needs to be an object." for the parameters JSON file.
The parameter JSON looks something like this:
...ANSWER
Answered 2021-Aug-06 at 09:41In Case 1, you are only matching files with a *.yml
extension and not a JSON extension. However, in Case 2, being your pre-commit hook, you do include json files as well. Meaning it will probably try to interpret your parameters JSON file as a CloudFormation file.
Your parameters file isn't CloudFormation however, it is a simple JSON array containing some values. A CloudFormation file is always an object, never an array at the top level. This would explain the error message. The solution: only include files in your cfn-python-lint scan that are actually CloudFormation files.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install cfn-python-lint
There are getting started guides available in the documentation section to help with integrating cfn-lint or creating rules.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page