How to create dynamo db stream event filter for a field from array of objects?

0

I want to create an event filter which should check, If status field for all the object inside the array is 'COMPLETED' then it should trigger the lambda.

example json

"parts": { "L": [ { "M": { "path": { "NULL": true }, "renditionGuid": { "S": "xyz" }, "status": { "S": "COMPLETED" } } }, { "M": { "path": { "NULL": true }, "renditionGuid": { "S": "xyz" }, "status": { "S": "COMPLETED" } } }

Is it possible to apply filter pattern like this?

asked 2 years ago1088 views
1 Answer
0

Hi,

Thanks for reaching out. Regrettably, this is not possible at the moment. I have reviewed our documentation and also checked with our Lambda team but there's currently no method or operator which can iterate through the list/array and then check each element. The closest we were able to get to is matching any object of the list that has "Status" = "Success".

There is currently no way of forcing all objects in the array to match the pattern and there will be a need to filter it further from the Lambda function itself.

AWS
SUPPORT ENGINEER
Ryan_A
answered 2 years ago
  • Hi, I am having a similar scenario but instead of "status" I have "timeStamp", is there a way to pick the "timeStamp" attribute out of the array of objects and filter out items that are after a particular time

  • @ryan_A is this still valid? does it apply on eventbridge fitlers as well?

  • Hi, please let know if this is still the case or we can iterate/check all the objects of the list for the matching value.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions