aws-template-validator
v1.0.7
Published
☁️ AWS CloudFormation Template Validator — Validate JSON/YAML templates directly with AWS
Maintainers
Readme
aws-template-validator
- ☁️ Validate AWS CloudFormation templates using the
AWS CloudFormation API (SDK v3). Works withJSONorYAMLtemplates. - 👨💻 Can be used as
CLIvianpx/global linkor asmodule - ♻️ Works seamlessly with
CommonJS,ESMandTypeScript
📦 Install via NPM
$ npm i aws-template-validator💻 Usage
CLI (Validate a local template file)
npx aws-template-validator ./my-template.yamlCommonJS
const { validateWithAWS } = require('aws-template-validator');
const templateFile = './path/to/my-template.yaml';
const runValidation = async () => {
try {
await validateWithAWS(templateFile);
} catch (err) {
console.error('❌ Template validation failed:', err)
}
}
runValidation();ESM
import { validateWithAWS } from 'aws-template-validator';
const templateFile = './path/to/my-template.yaml';
const runValidation = async () => {
try {
await validateWithAWS(templateFile);
} catch (err) {
console.error('❌ Template validation failed:', err)
}
}
runValidation()TypeScript
import { validateWithAWS } from 'aws-template-validator';
const templateFile: string = './path/to/my-template.yaml';
const runValidation = async () => {
try {
await validateWithAWS(templateFile);
} catch (err) {
console.error('❌ Template validation failed:', err)
}
}
runValidation();