According to the AWS Lambda event filtering, you can filter events by the existence of keys like so {"foo":[{"exists":true}]}. However, through much trial and error, I found that this only applies to keys that contain a JSON primitive and not a nested structure.
e.g. the above filter will work for
{
"foo": "bar"
}
but not for
{
"foo": { "baz": "bar"}
}
If you wanted to match the latter event, your filter will need to drill e.g. {"foo":{"baz":[{"exists":true}]}}
This can be especially easy to miss when triggering on Dynamo steams events since the payload is in DynamoJSON format.
Is this a bug or intentional?