1 Answer
- Newest
- Most votes
- Most comments
0
As you can here, the event that your Lambda receives is like this:
{
"eventID": "c9fbe7d0261a5163fcb6940593e41797",
"eventName": "INSERT",
"eventVersion": "1.1",
"eventSource": "aws:dynamodb",
"awsRegion": "us-east-2",
"dynamodb": {
"ApproximateCreationDateTime": 1664559083.0,
"Keys": {
"SK": { "S": "PRODUCT#CHOCOLATE#DARK#1000" },
"PK": { "S": "COMPANY#1000" }
},
"NewImage": {
"quantity": { "N": "50" },
"company_id": { "S": "1000" },
"fabric": { "S": "Florida Chocolates" },
"price": { "N": "15" },
"stores": { "N": "5" },
"product_id": { "S": "1000" },
"SK": { "S": "PRODUCT#CHOCOLATE#DARK#1000" },
"PK": { "S": "COMPANY#1000" },
"state": { "S": "FL" },
"type": { "S": "" }
},
"SequenceNumber": "700000000000888747038",
"SizeBytes": 174,
"StreamViewType": "NEW_AND_OLD_IMAGES"
},
"eventSourceARN": "arn:aws:dynamodb:us-east-2:111122223333:table/chocolate-table-StreamsSampleDDBTable-LUOI6UXQY7J1/stream/2022-09-30T17:05:53.209"
}
As you only want inserts, your filter pattern should look like this:
{ "eventName": ["INSERT"]}
In your case you specified event_name
.
Relevant content
- asked 2 years ago
- asked a year ago
- asked a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated 7 months ago
Thank you, I tried that earlier, but didn't work and changed it to event_name. BUT it is working now. Does it take some time to reflect the filter pattern?
Also, I am making a second filter for valid in NewImage. Here is what I've tried; { "dynamodb": { "NewImage": { "valid": { "BOOL": [false] }}}} I've replaced BOOL with B, BOOLEAN, Bool, but none work so far.
Based off of the scalarAttributeType enum, I'm guessing the correct choice is B, but not sure why it doesn't work.
Ok, it's flowing through now, I just needed a bit more patience. 5-10min for others who might find it useful.