Skip to content

Instantly share code, notes, and snippets.

@mdesanti
Last active March 31, 2016 14:33
Show Gist options
  • Save mdesanti/87b301d118cd06a56f54 to your computer and use it in GitHub Desktop.
Save mdesanti/87b301d118cd06a56f54 to your computer and use it in GitHub Desktop.
Lambda + SimpleDb list
var AWS = require('aws-sdk');
exports.handler = function(event, context) {
var AWS = require('aws-sdk');
var simpledb = new AWS.SimpleDB({
endpoint: 'sdb.amazonaws.com',
region: 'us-east-1'
});
console.log(event)
var params = {
SelectExpression: 'SELECT * FROM your_domain', /* required */
};
simpledb.select(params, function(err, data) {
if (err) {
console.log(err);
context.fail("Internal Error: " + JSON.stringify(err));
} else {
console.log(data);
context.succeed(data.Items);
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment