I'm attempting to match events using an eventbridge rule. However I need to match the event if it's array contains an object with some particular properties and I'm struggling with how to do that.
An example event:
{
"version": "0",
"id": "396bfea8-6311-c1ab-44cf-d44d93014a89",
"detail-type": "ExampleEvent",
"source": "example.com",
"account": "207772098559",
"time": "2020-05-31T19:44:55Z",
"region": "eu-west-1",
"resources": [],
"detail": {
"Id": "2fbf7f1b0b0f462ba16b6076812f1b77",
"Data": {
"entities": [
{
"entityType": "task",
"action": "update",
"entityId": "bbf74ec6-8762-48d6-b09f-23a97834fc2f"
},
{
"entityType": "note",
"action": "update",
"entityId": "bbf74ec6-8762-48d6-b09f-23a97834fc2f"
}
]
}
}
}
I would like the rule to match where the entities collection contains any items with both entityType task and action update. I'd imagined it would look like the below but this gets the error "Unrecognized match type entityType" as it's thinking that the object inside the array means I'm trying to use one of the supported match types.
{
"source": [
"example.com"
],
"detail-type": [
"ExampleEvent"
],
"detail": {
"Data": {
"entities": [
{
"entityType": [
"Task"
],
"action": [
"update"
]
}
]
}
}
}