0

I have a DynamoDB stream configured to trigger a lambda. Most inserts to the table do go to the lambda, but I have a number of them that seem to never go to the lambda. At the top of my lambda, I log the received event, which includes the keys of the items it received. I am searching for those keys in my CloudWatch logs for the lambda, and they never appear. Is there some way to debug why DynamoDB may not be sending these items, or is it possible that the lambda is polling incorrectly?

srchulo
  • 5,143
  • 4
  • 43
  • 72
  • I would guess that this is more to do with a temporary inconsistency in CloudWatch Logs than it is to a failure of DynamoDB Streams. One way to check might be to have your Lambda function write the key data elsewhere e.g. a different DynamoDB table or a small JSON object in S3. – jarmod Jun 03 '20 at 19:18
  • @jarmod Ah, are CloudWatch logs not reliable? That's a good idea to log it elsewhere. – srchulo Jun 03 '20 at 19:33
  • It's not that CW Logs is unreliable, it's that there is some latency there and it's easy to look in the wrong place e.g. the wrong log stream (or an unrefreshed view of the correct log stream). How are you searching for evidence that a given item was inserted? – jarmod Jun 03 '20 at 19:39
  • So I know the item was inserted because it's in the table. But then my lambda logs the receipt of each item from the stream (I don't see these items), and then it updates the item in the table, but these items have no updates like they were never processed, but most items are updated. I also see no errors for the lambda, so it doesn't seem like it crashed and failed to update. – srchulo Jun 03 '20 at 20:27
  • Are you correctly handling situations in which there are multiple streamed records in a single Lambda invocation? – jarmod Jun 04 '20 at 00:16
  • Yes, I loop over each event and process each one individually (except I only process inserts-- anything else I ignore) – srchulo Jun 04 '20 at 01:31

0 Answers0