Skip to content

Commit d5347be

Browse files
authored
Merge pull request aws-samples#174 from anilbhaskaran/main
Lambda-Dynamodb code snippet - Typescript
2 parents d926f2b + 60f455e commit d5347be

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
export const handler = async (event, context) => {
4+
console.log(JSON.stringify(event, null, 2));
5+
event.Records.forEach(record => {
6+
logDynamoDBRecord(record);
7+
});
8+
}
9+
const logDynamoDBRecord = (record) => {
10+
console.log(record.eventID);
11+
console.log(record.eventName);
12+
console.log(`DynamoDB Record: ${JSON.stringify(record.dynamodb)}`);
13+
};

0 commit comments

Comments
 (0)