Skip to content

[Enhancement] Add Support for Arithmetic Operations #584

Description

@lizhunt-aws

Is your feature request related to a problem? Please describe.

I'd like to do some basic math in assertions and counts() outside of the binary comparison operations.

Describe the solution you'd like

Be able to parse and validate a rule similar to the following:

let minimum_tag_ratio = 0.95
rule tag_ratio_must_be_over_sla {
    let all_resources_to_check =  Resources.*[ Type == /AWS::IAM::Role/ ]
    let found_required_tags = Resources.*[
        Type == /AWS::IAM::Role/
        Properties.Tags[*].Key == ...blahblah
        ...blah
    ]
    (count(%found_required_tags) / count(%all_resources_to_check)) >= %minimum_tag_ratio
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions