Nakano
Nakano

Reputation: 27

How can I filter AWS EventBridge events based on multiple conditions for the same field? [Event Pattern]

I'm trying to set up an event pattern in AWS EventBridge to filter events based on the tableName field. I want to exclude events where tableName starts with either database_1 or database_2. This condition worked well.

Now, I'm trying to add a new condition to exclude events where tableName ends with _test. However, I'm struggling to combine these two conditions in the event pattern. Does anyone know how to do this for the same field within detail?

Here's what I've tried so far:

   {
      "detail": {
        "typeOfChange": ["CreateTable", "UpdateTable"]
        "tableName": [{
          "anything-but": {
            "prefix": ["database_1", "database_2"]
          }, 
          { 
            "suffix": "_test" 
          }
        }]
      },
      "source": ["aws.glue"]
    }

Any help would be appreciated.

Upvotes: 1

Views: 1033

Answers (1)

Related Questions