mapbox / cloudfriend

Helper functions for assembling CloudFormation templates in JavaScript
ISC License
69 stars 9 forks source link

Add top-level Rules support to merge #120

Closed hcourt closed 3 years ago

hcourt commented 3 years ago

This PR prevents cf.merge from removing Rules from the top-level template, allowing users to add complex validations.

Rules is similar to other top-level sections, in that it's an object with keys that are unique and values that are objects. Each rule has:

Assert and RuleCondition accept rule-specific intrinsic functions, which partly overlap with general CFN intrinsic functions. ~This PR doesn't add those, for clarity and because that will take longer -- but I'm preparing a PR for that, too.~ I added these to fa26729.

cc/ @mapbox/release-engineering for review, please

hcourt commented 3 years ago

Just tested the new cf.merge on an internal usecase, looks great!