A command-line tool for validating CloudFormation templates quickly.
CloudFormation is great. Unfortunately, the error handling leaves a bit to be desired.
The AWS CLI provided
validate-template command only
syntax, not the actual resources, their properties, etc. This means you can think you're successfully creating a new stack, and still get a
CREATE_FAIL. This tool aims to give you quick feedback so you spend less time banging your head against the CloudFormation Console.
npm install -g cfn-check
Usage: cfn-check [options] <template> Options: -h, --help output usage information -V, --version output the version number -w, --watch Watch template for changes -p, --pretty Print pretty JSON when valid (regardless of character limit) -c, --compact Print compact JSON when valid (regardless of character limit)
quietdon't output anything, just set return code.
verboseincrease the logging level.
Refs are valid parameters, resources, or pseudo parameters.
Typeproperties are valid Types as defined in the Resource Types Reference, including Custom Resources.
cfn-checkonly validates <= '2010-09-09'
Fns can only be used in resource properties, metadata attributes, and update policy attributes.
The resource properties definitions are taken from the CloudFormation User Guide Resource Types Reference.
To update the definitions (stored in data/resources.json) run:
npm run scrape
To run the tests:
To watch them:
npm run test:watch
areValidtests in favour of CLI-level testing