Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

329
Vistas
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 Respuestas
Responde la pregunta

0

This pattern should work to match this event:

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

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda