| repo | url | homepage | starredAt | createdAt | updatedAt | language | license | branch | stars | isPublic | isTemplate | isArchived | isFork | hasReadMe | refreshedAt | description | tags |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
gristlabs/yaml-cfn |
2025-01-14T05:00:20Z |
2017-10-20T20:34:08Z |
2025-01-14T05:00:20Z |
JavaScript |
Apache-2.0 |
master |
32 |
true |
false |
false |
false |
true |
2025-02-25T19:51:16.587Z |
Parser and schema for CloudFormation YAML templates |
Parser and schema for CloudFormation YAML template tags.
Implements support for AWS-specific CloudFormation YAML schema.
The implementation and tests are based on the official AWS Python client aws-cli. It supports all intrinsic CloudFormation functions listed in AWS docs as of October 2017.
npm install --save-dev yaml-cfnconst { yamlParse, yamlDump } = require('yaml-cfn');
const input = `
Key:
- !GetAtt Foo.Bar
- !Equals [!Ref Baz, "hello"]
`;
const parsed = {
"Key": [
{"Fn::GetAtt": ["Foo", "Bar"]},
{"Fn::Equals": [{"Ref": "Baz"}, "hello"]}
]
};
assert.deepEqual(yamlParse(input), parsed);
assert.deepEqual(yamlParse(yamlDump(parsed)), parsed);The module uses js-yaml. The schema it uses is also exported, and may be used e.g. like so:
const { schema } = require('yaml-cfn');
const yaml = require('js-yaml');
yaml.safeLoad(input, { schema: schema })