I have a DynamoDB table with a stream of type: NEW_IMAGE
, but i only get new added items to the db in the stream.
I don't get the data of when an existing item was modified.
Is there a way to do this in streams? To send the data of the updated existing items in a stream as well as new items?
Below is my Serverless code
OrdersTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: OrdersTable-${self:provider.stage}
BillingMode: PAY_PER_REQUEST
AttributeDefinitions:
- AttributeName: id
AttributeType: S
- AttributeName: createdAt
AttributeType: S
- AttributeName: ticker
AttributeType: S
- AttributeName: orderRate
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
- AttributeName: createdAt
KeyType: RANGE
GlobalSecondaryIndexes:
- IndexName: ticker_orderRate
KeySchema:
- AttributeName: ticker
KeyType: HASH
- AttributeName: orderRate
KeyType: RANGE
Projection:
ProjectionType: ALL
StreamSpecification:
StreamViewType: NEW_IMAGE