Last active
April 3, 2018 13:21
-
-
Save jenseickmeyer/cc3ce96671fbd76864dc9ea9df2979ea to your computer and use it in GitHub Desktop.
AWS Lambda function using async/await
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
'use strict'; | |
const aws = require('aws-sdk'); | |
const dynamoDB = new aws.DynamoDB.DocumentClient(); | |
exports.handler = async (event, context) => { | |
return await getItems(); | |
}; | |
async function getItems() { | |
const params = { | |
TableName: 'TABLENAME' | |
}; | |
const data = await dynamoDB.scan(params).promise(); | |
return data.Items; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment