Instantly share code, notes, and snippets.

Embed
What would you like to do?
AWS Lambda DynamoDB PUT
var AWS = require('aws-sdk');
var dynamodb = new AWS.DynamoDB.DocumentClient();
exports.handler = (event, context, callback) => {
dynamodb.scan({
TableName: 'ggmug'
}, (err, data) => {
if (err) {
console.log('Error putting item into dynamodb failed: ' + err);
callback('500');
}
else {
console.log('saved');
callback(null, data.Items);
}
});
console.log('done');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment