start simple policy logic

This commit is contained in:
drudge 2023-11-26 20:15:23 -08:00
parent 6b69bbf7df
commit b2b09cbf64
2 changed files with 7 additions and 0 deletions

View file

@ -0,0 +1,2 @@
# Quantifier, resource, key to require, value to require
all aws_ebs_volume resources have required tag "foo" with required value "bar"

View file

@ -11,6 +11,11 @@ sub get-resource-type (@resource-list, Str $resource-type, Str $mode="managed")
@resource-list.grep: { $_<mode> eq $mode && $_<type> eq $resource-type }
}
# This will ultimately need to parse rule text and perform operations based on that. Example rule:
# all aws_ebs_volume resources have required tag "foo" with required value "bar"
sub read-rule (Str $rule-text) {
}
sub check-tags ($resource, %required_tags) {
return True if %required_tags.grep($resource<change><after><tags_all><foo>); # or $resource.change.after.tags<foo> eq "bar";