Created
April 13, 2022 09:18
-
-
Save niraj8/5e5b01706463f50f4c9a3d4458babd75 to your computer and use it in GitHub Desktop.
Log events & count of records received
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.handler = async (event, context) => { | |
event.Records.forEach(record => { | |
console.log(record.body); | |
}); | |
console.log('## EVENT: ' + serialize(event)); | |
console.log('## Number of Records: ' + event.Records.length); | |
return true; | |
}; | |
const serialize = function(object) { | |
return JSON.stringify(object, null, 2); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment