0

I noticed the NEW IMAGE in dynamodb stream always has these two fields: "Message":"New item!" "Id":"101" These values are always there UNLESS my record itself has a Id and a Message field, in which case the default values are overridden. But since my table doesn't have "Id" and "Message" attributes, these values are ALWAYS present. Is this expected behavior?

I created sample dynamodb stream record:

Records: [
      {
        eventID: "1",
        eventVersion: "1.0",
        dynamodb: {
          Keys: {
            id: {
              N: "101"
            }
          },
          NewImage: {
            Data: {
              S: "New data!"
            },
            id: {
              N: "99"
            }
          },
          OldImage: {
            Data: {
              S: "Old data!"
            },
            id: {
              N: "99"
            }
          },
          StreamViewType: "NEW_AND_OLD_IMAGES",
          SequenceNumber: "111",
          SizeBytes: 26
        },
        awsRegion: "xyz",
        eventName: "INSERT",
        eventSourceARN: "xyz",
        eventSource: "aws:dynamodb"
      }
    ]

When unmarshalling record.dynamodb.NewImage, I get a NewImage as follows:

"NewImage":{"Message":"New item!", "Id":101, "Data":"New data!", "id":99}
Ahmed
  • 121
  • 6
  • 18

0 Answers0