I'm trying to create an AWS EventBridge rule, and I need to filter out events based on detail.type.
Each of these rules works separately:
Rule 1: This successfully filters out "foo-v2" and "bar-v2":
"detail": {
"type": [{
"anything-but": ["foo-v2", "bar-v2"]
}]
}
Rule 2:
This successfully filters out anything containing datasync:
"detail": {
"type": [{
"anything-but": {
"wildcard": "*datasync*"
}
}]
}
I've tried just about every different combination of these two but was not able to get one that was successful, does anyone have any advice on how I can combine both of these into one rule.
I'm trying to create an AWS EventBridge rule, and I need to filter out events based on detail.type.
Each of these rules works separately:
Rule 1: This successfully filters out "foo-v2" and "bar-v2":
"detail": {
"type": [{
"anything-but": ["foo-v2", "bar-v2"]
}]
}
Rule 2:
This successfully filters out anything containing datasync:
"detail": {
"type": [{
"anything-but": {
"wildcard": "*datasync*"
}
}]
}
I've tried just about every different combination of these two but was not able to get one that was successful, does anyone have any advice on how I can combine both of these into one rule.
Share Improve this question asked Feb 15 at 4:00 terrablterrabl 9243 gold badges11 silver badges24 bronze badges1 Answer
Reset to default 0You can use anything-but with wildcard and evaluate a set of items in a list.
Try adding just the wildcards for one of the items like the following:
"detail": {
"type": [{
"anything-but": {"wildcard": ["foo-v2", "bar-v2", "*datasync*"]}
}]
}
Comparison operators for use in event patterns in Amazon EventBridge