Menu
AWS Lambda
Developer Guide

Step 2.1: Create a Lambda Function Deployment Package

Follow the instructions to create an AWS Lambda function deployment package.

  1. Open a text editor, and then copy the following code.

    Copy
    console.log('Loading function'); exports.handler = function(event, context, callback) { console.log('value1 =', event.key1); console.log('value2 =', event.key2); console.log('value3 =', event.key3); callback(null, "Success"); };

    Note

    The code sample is compliant with the Node.js runtimes v6.10 ore v4.3. For more information, see Programming Model (Node.js)

  2. Save the file as helloworld.js.

  3. Zip the helloworld.js file as helloworld.zip.

Note

To see more examples of using other AWS services within your function, including calling other Lambda functions, see AWS SDK for JavaScript