Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dab35b6 commit 5951693Copy full SHA for 5951693
integration-ddb-to-lambda-with-batch-item-handling/example.rb
@@ -0,0 +1,18 @@
1
+# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+# SPDX-License-Identifier: Apache-2.0
3
+def lambda_handler(event:, context:)
4
+ records = event["Records"]
5
+ cur_record_sequence_number = ""
6
+
7
+ records.each do |record|
8
+ begin
9
+ # Process your record
10
+ cur_record_sequence_number = record["dynamodb"]["SequenceNumber"]
11
+ rescue StandardError => e
12
+ # Return failed record's sequence number
13
+ return {"batchItemFailures" => [{"itemIdentifier" => cur_record_sequence_number}]}
14
+ end
15
16
17
+ {"batchItemFailures" => []}
18
0 commit comments