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:
Assertions, an array of objects with AssertDescription (a string) and Assert (a function) keys.
An (optional) RuleCondition, a function
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
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:Assertions
, an array of objects withAssertDescription
(a string) andAssert
(a function) keys.RuleCondition
, a functionAssert
andRuleCondition
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