Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

321
Views
Amazon EventBridge: Match an object inside of an array

I've stuck the problem with defining a rule for matching my events. Googled, tested.

Let's say, we've the following event which contains the object user in the array events:

{
    "version": "0",
    "...": "...",
    "detail": {
        "events": [
            {
                "user": {
                    "id": "5efdee60b48e7c1836078290"
                }
            }
        ]
    }
}

Is there any way to match the user.id in an EventBus rule? I've already tried to use the following rule which is not valid:

{
  "detail": {
    "events": [
      {
        "user": {
          "id": [
            "5efdee60b48e7c1836078290"
          ]
        }
      }
    ]
  }
}

then,

{
  "detail": {
    "events[0]": {
      "user": {
        "id": [
          "5efdee60b48e7c1836078290"
        ]
      }
    }
  }
}

also no effect.

I don't want to give up, but I'm tired with it ;)

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

This pattern should work to match this event:

{
  "detail": {
    "events": {
      "user": {
        "id": [
          "5efdee60b48e7c1836078290"
        ]
      }
    }
  }
}
over 4 years ago · Santiago Trujillo Report

0

Today, EventBridge only supports matching simple values (string, integer, boolean, null) with an array. You can read more in the service documentation.

over 4 years ago · Santiago Trujillo Report

0

I did some playing around with your example but I can't make it work. Based on reading the Arrays in EventBridge Event Patterns I have to conclude that matching inside arrays with complex values is not possible.

The quote that seems to confirm this is "If the value in the event is an array, then the pattern matches if the intersection of the pattern array and the event array is non-empty."

And from the Event Patterns page "Match values are always in arrays." So if your pattern is an array and the value in the event is also an array (this is the example you gave), a "set" based intersection test is performed. Your pattern would have to match the entire array entry, not just a single field like you have in the example.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!