github aws-cloudformation/cloudformation-guard 3.0.1
v3.0.1

latest releases: action-v0.0.5, pre-commit-v0.0.2, action-v0.0.4...
12 months ago

What's Changed

Details

Added support for conversion functions

To improve the user experience for validating templates when schemas use types that might be easier evaluated as a different type (i.e. a string thats actually a number) the 3.0.1 release adds support to convert between specific types.

The conversions allowed are the following
strings/floats-> ints
strings/ints -> floats
strings -> bools
bools/floats/ints -> strings

The following is an example of parsing a string into an int.

Given the following template:

Resources:
  asg:
    Type: AWS::AutoScaling::AutoScalingGroup
    Properties:
      MinSize: "1"

We can write the following rule

let asg = Resources.*[ Type == 'AWS::AutoScaling::AutoScalingGroup' ]

rule test_parse_int when %asg !empty {
   let min = parse_int(%asg.Properties.MinSize)

   %min == 1
}

Full Changelog: 3.0.0...3.0.1

Don't miss a new cloudformation-guard release

NewReleases is sending notifications on new releases.