Introducing lambda-uploader, A Module for Uploading an AWS Lambda Function from Node.js
@kylewbanks on Aug 26, 2015.
Written by Hey, if you didn't already know, I'm currently working on an open world stealth exploration game called Farewell North in my spare time, which is available to wishlist on Steam!
lambda-uploader is a Node.js module for uploading a source directory to AWS Lambda as a function.
Installation
npm install lambda-uploader
Usage
Assuming you have a folder called /path/to/lambda-function that contains the source code and dependencies of a Lambda function:
var lambdaUploader = require('lambda-uploader'); lambdaUploader.uploadFunction( 'us-east-1', // Region 'my-awesome-function', // Function Name '/path/to/lambda-function', // Lambda Function Source Directory 'index.handler', // Handler Name '<Lambda Execution Role ARN>', 512, // Memory in Megabytes 30, // Timeout in Seconds function(err) { if (err) { throw err; } console.log("Lambda function uploaded!"); } );
Source Code
As always, the source code is available on GitHub and contributions are more than welcome.
Let me know if this post was helpful on Twitter @kylewbanks or down below!