- 最新
- 投票最多
- 评论最多
Before digging into this further, let me confirm one thing:
- How is your DynamoDB Stream configured, ensure it produces
NEW_AND_OLD_IMAGES
. Docs
Your pattern should look like this:
{"eventName": ["MODIFY"], "dynamodb": {"NewImage": {"status": { "N": [{"numeric": [">", 10]}]}}}}
Note the "N" which is part of the object.
That doesn't work sadly so and is one of the countless possibilities I tried. The Lambda shows the following configured pattern:
{ "filters": [ { "pattern": "{\"eventName\": [\"MODIFY\"], \"dynamodb\": {\"NewImage\": {\"status\": { \"N\": [{\"numeric\": [\">\", 10]}]}}}}" } ] }
but after modifying a record in the database (both by editing inline using the console and updating the record's status by code) the last processing result on the table still states "No records processed", and I can confirm that the Lambda does not trigger.
I have had the same problem using dynamodb kinesis stream. Also I had removed the filterCriteria after dealing with this issue, and the events were still filtering. Confirmed there was no filter in place with the cli, and in the console. Seems like some weird behavior from the filterCriteria. I had to delete the entire stack to remove the filter. Interested to see what your outcome is.
相关内容
- AWS 官方已更新 2 年前
- AWS 官方已更新 1 年前
It is configured to produce the new image:
stream: StreamViewType.NEW_IMAGE
. In the meantime I made some progress. I was able to get an exact match on the status field working by using the following filter:{"dynamodb":{"NewImage":{"status":{"N":["20"]}}}}
. It seems that the data type needs to be included in the filter and the value needs to be quoted (even though the documentation specifies otherwise). However I can't get more advanced filters to work for the life of me, e.g. (from the documentation):