terrabl
terrabl

Reputation: 944

Why can't I combine multiple anything-but conditions in AWS EventBridge event patterns?

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.

Upvotes: 0

Views: 43

Answers (1)

Ale Sosa
Ale Sosa

Reputation: 188

You 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

Upvotes: 0

Related Questions