Skip to content

Instantly share code, notes, and snippets.

@niraj8
Created April 13, 2022 09:18
Show Gist options
  • Save niraj8/5e5b01706463f50f4c9a3d4458babd75 to your computer and use it in GitHub Desktop.
Save niraj8/5e5b01706463f50f4c9a3d4458babd75 to your computer and use it in GitHub Desktop.
Log events & count of records received
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