Search code examples
amazon-web-servicesaws-lambdaamazon-dynamodb

DynamoDB Stream Lambda trigger not sending "INSERT" events to Lambda


I have a DynamoDB table with a stream enabled for NewImages to trigger a Lambda function. For some reason I am only seeing events trigger the Lambda with eventName: "MODIFY", and no events with eventName: "INSERT" triggering the Lambda. I have Lambdas elsewhere that are creating new items via DynamoDB.putItem, which as far as I know should be triggering the Lambda with eventName: "INSERT". Is INSERT only invoked by other actions? My DynamoDB table has 2 global secondary indexes if that is relevant.


Solution

  • PutItem will invoke an Lambda with INSERT if the item is a new item. If the item already existed, it will become invoke it with a MODIFY.

    1. Check you are adding new data
    2. Check you aren't using an event filter
    3. Check you aren't filtering within the Lambda and missing INSERT events.