Giter Site home page Giter Site logo

node-lambda-template's Introduction

If you found this useful, consider also checking out dotenv-vault. Thank you! ๐Ÿ˜‡

node-lambda-template

node-lambda-template

The bare minimum for a node.js app running on Amazon Lambda.

It uses node-lambda under the hood to locally run and also deploy your node.js Amazon Lambda application.

Install

Clone this repository.

cd /to/your/template/path
npm install

Usage

There are 4 available commands to use on this template. For more info and usage descriptions, see the node-lambda repository.

cd /to/your/template/path
npm run setup # setup node-lambda files
npm run test # test your event handler and check output
npm run package # just generate the zip that would be uploaded to AWS
npm run deploy # deploy to AWS

node-lambda-template's People

Contributors

andregapper avatar davidguttman avatar deviavir avatar honzie avatar motdotla avatar stonecypher avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-lambda-template's Issues

" Validation error ... Member must satisfy regular expression pattern: arn:aws:iam:: ..."

I'd love to be able to use your project to run Lambda functions. Unfortunately, I'm getting stuck at the initial steps. I'm hoping you wouldn't mind providing a hint to get me past a roadblock.

I've tried to create a AWS user, role, and policy to allow node-lambda to work. When I try using node-lambda to deploy the node-lambda-template, I see this error:

[/_/Workspace/gits/node-lambda-template]$ ./node_modules/.bin/node-lambda deploy               [master] 
Generating zip file
Reading zip file to memory
Uploading zip file to AWS Lambda with parameters:
{ FunctionName: 'tutorial-development',
  FunctionZip: <Buffer 50 4b 03 04 14 00 00 00 08 00 29 17 99 46 a9 f3 94 05 8e 00 00 00 4b 01 00 00 08 00 1c 00 69 6e 64 65 78 2e 6a 73 55 54 09 00 03 cd 3a 3b 55 d1 3a 3b 55 ...>,
  Handler: 'index.handler',
  Mode: 'event',
  Role: 'lambda_basic_execution',
  Runtime: 'nodejs',
  Description: '',
  MemorySize: '128',
  Timeout: '3' }
{ [ValidationException: 1 validation error detected: Value 'lambda_basic_execution' at 'role' failed to satisfy constraint: Member must satisfy regular expression pattern: arn:aws:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+]
  message: '1 validation error detected: Value \'lambda_basic_execution\' at \'role\' failed to satisfy constraint: Member must satisfy regular expression pattern: arn:aws:iam::\\d{12}:role/?[a-zA-Z_0-9+=,.@\\-_/]+',
  code: 'ValidationException',
  time: Sat Apr 25 2015 03:15:57 GMT-0400 (EDT),
  statusCode: 400,
  retryable: false,
  retryDelay: 30 }

Here is a screenshot of my AWS setting for a user 'node-lambda' that I created for using your project:

screenshot from 2015-04-25 03 17 47

Do you have any advice for me?

Builds inappropriate resources into zip

Default project builds dependencies of node-lambda into lambda zipfile. Hello world now carries commander, graceful-readlink, sax, xml2js, xmlbuilder, etc. ~771k of deps.

Template builds inappropriate resources into zip by misapplying lists of downstream resources

Default project builds dependencies of node-lambda into lambda zipfile. Hello world now carries commander, graceful-readlink, sax, xml2js, xmlbuilder, etc. ~771k of deps.

New project maintainer closed the original #4 because he misunderstands it. I was trying to explain but he locked the issue because I asked him to not close it.

The actual problem is not that node-lambda builds things in because they're in use; it's that node-lambda-template is incorrectly propositioning its own tools as part of the downstream build.

This is a problem in the template, despite that the new maintainer closed an issue while the issue's creator was trying to explain what they misunderstood.

@motdotla - please help with the overly aggressive new issue burying mod, thanks

Update to package.json to latest version of node-lambda.

Hi.

Firstly - thanks for the awesome repo.
I see there are a few PRs piling up regarding updating the version of node-lambda referenced
in package.json.

  • #5 (requesting bump to ^0.7.1)
  • #8 (requesting bump to 0.1.5)

As of my writing, the current version is 0.8.13, which obviates both PRs.

So - I'm hoping this issue can be a stand-in to update to latest, whatever it is when you take on the work. Since this app is a many people's first brush with using node-lambda, it would be nice if running node-lambda setup wrote the newest version of .env.

Thanks again for your work.

AWS Lambda Node v4.3.2 deprecated context.done() in favor of callbacks

Now that AWS Lambda Node.js 0.10 has been officially deprecated, I think we should update the index.js to something like this:

exports.handler = function( event, context, callback ) {
  console.log( "Running index.handler" );
  console.log( "==================================");
  console.log( "event", event );
  console.log( "==================================");
  console.log( "Stopping index.handler" );
  callback(null, data);
}

Ref: https://aws.amazon.com/blogs/compute/node-js-4-3-2-runtime-now-available-on-lambda/

'npm run test' and 'node-lambda run' behaves subtly differently

It happens to me when the logs didn't show up as expected after I installed a few dependencies and the size of the folder increased quite a bit. After a few trials and errors it turned out that 'npm run test' and 'node-lambda run' were indeed giving different outputs. I am not sure why but I think that this bug might not be worth fixing. It might be better to just let the users to use the node-lambda cli commands.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.