exports.handler = function()

in lib/lambdas/stream-lambda/index.js [60:87]


exports.handler = function (event) {

    // Process DynamoDB Streams event records
    event.Records.forEach(record => {
        // For all INSERT records, we provision a new deployment

        if (record.eventName == 'INSERT') {
            console.log('New item added to deployment database');
            console.log(record.dynamodb);

            startBuildCommand(record.dynamodb.NewImage);
        }

        // This sample code does not process MODIFY or DELETE records
        // Implementation of business logic related to these events is
        // left for the reader.

        if (record.eventName == 'MODIFY') {
            // TODO
        }

        if (record.eventName == 'DELETE') {
            // TODO
        }

    });

};