Answers for "how to call multiples Events in AWS lambda function"

0

how to call multiples Events in AWS lambda function

exports.handler = async (event, context, callback) => {
    const type = event.type;
    if (type === 'all') {
        const params = {
            TableName: 'compare-yourself'
        }
        try {
            const data = await dynamodb.scan(params).promise()
            callback(null, data)
        } catch(error) {
            callback(error);
        }
    } else if (type === 'single') {
        callback(null, 'Just my data');
    } else {
        callback(null, 'Hello from Lambda');
    }
};
Posted by: Guest on October-05-2021

Code answers related to "how to call multiples Events in AWS lambda function"

Code answers related to "Javascript"

Browse Popular Code Answers by Language