Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Add Support for Arithmetic Operations #584

Open
lizhunt-aws opened this issue Nov 12, 2024 · 1 comment
Open

[Enhancement] Add Support for Arithmetic Operations #584

lizhunt-aws opened this issue Nov 12, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@lizhunt-aws
Copy link
Contributor

lizhunt-aws commented Nov 12, 2024

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
}
@lizhunt-aws lizhunt-aws added the enhancement New feature or request label Nov 12, 2024
@joshfried-aws
Copy link
Contributor

Hey @lizhunt-aws, thanks for the suggestion. This is definitely something I could see a lot of benefit to adding. We're going to talk it over with the team and will update this ticket in the future as necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants