Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Aug 01 2019 16:35
    praveenvelampudi7 commented #49
  • May 29 2018 19:21
    contractorwolf commented #49
  • May 10 2018 02:55
    deoresheetal commented #49
  • Sep 27 2017 13:25
    contractorwolf unassigned #49
  • Sep 27 2017 13:25
    contractorwolf commented #49
  • May 12 2017 15:22

    EFF on master

    Update README.md (compare)

  • May 12 2017 15:21
    EFF closed #70
  • May 12 2017 15:21
    EFF commented #70
  • May 11 2017 00:04
    Echelonsecretintelligenceofficer commented #70
  • Feb 13 2016 03:45
    vboctor opened #70
  • Jan 13 2016 18:31

    EFF on master

    Update README.md (compare)

  • Dec 11 2015 22:00
    adelevie opened #69
  • Oct 23 2015 15:55
    EFF commented #68
  • Oct 16 2015 18:31
    jakelodwick opened #68
  • Oct 06 2015 15:52
    oortlieb commented #67
  • Oct 06 2015 15:47
    slvnperron commented #67
  • Oct 06 2015 15:34
    oortlieb opened #67
  • Oct 01 2015 04:45
    chrxn commented #66
  • Sep 29 2015 17:00

    slvnperron on master

    Added 'logs:*' as a required pe… Merge pull request #66 from chr… (compare)

  • Sep 29 2015 17:00
    slvnperron closed #66
Sylvain Perron
@slvnperron
@rantonmattei you’re right, we’ll do that. Feel free to make a PR if you happen to know how to do this quickly. The CLI isn’t working with npm for some reason, but if you pull master you can run the CLI with node bin/lambdaws-cli
Luciano Bertenasco
@lbertenasco
@slvnperron good info, i mistakenly thought the default was 20s. i've just changed my config adding "uploadTimeout: 120000" (just to be safe) and it seems it fixed the issue.
I re-uploaded it several times to give it a good try and it does not break, thank you very much!
EFF
@EFF
@lbertenasco good to hear !
Sylvain Perron
@slvnperron
@lbertenasco Glad it fixed your issue!
Sylvain Perron
@slvnperron
@lbertenasco The CLI’s fixed in 1.0.14
Raphaël Antonmattei
@rantonmattei
Thanks, that's great
Raphaël Antonmattei
@rantonmattei
Hi there
I am working with S3 events
and the way the user function is called does not allow that because you call :
func.apply(this, event.args);
If I change this to
func.apply(this, [event, context]);
this works fine
so, I was about to submit a PR for that
however I ran into another issue with this line
event.args.push(doneCallback);
https://github.com/mentum/lambdaws/blob/master/lib/LambdaHelper.js#L46
because in my case, the args property is not defined
Here is the event object I get back from the invocation
[ { eventVersion: '2.0', eventSource: 'aws:s3', awsRegion: 'us-east-1', eventTime: '2015-03-18T15:40:07.417Z', eventName: 'ObjectCreated:Put', userIdentity: [Object], requestParameters: [Object], responseElements: [Object], s3: [Object] } ] }
So, that line triggers an error
Failure while running task: TypeError: Cannot call method 'push' of undefined at __lambda__ (/var/task/index.js:13:20)
Raphaël Antonmattei
@rantonmattei
So, it seems there are differences between your examples (calling lambda from a local process) and what I am doing (calling from an S3 events)
In your example, you do need args
var minus = function(a, b, callback) { /*...*/ };
With S3 events you need the entire event obj and the context
var myFunc = function(event, context) { /*...*/ };
So, if I add my change, it's going to break the scenario in your example
Raphaël Antonmattei
@rantonmattei
so, here is what I suggest:
function __lambda__ (event, context) {
    var utils               = require('./_utils'),
        callbackHandler     = require('./_callbackHandler'),
        externalsHandler    = require('./_externalsHandler');

    var doneCallback = callbackHandler.getCallback(event, context);

    if (event.args) {
        event.args.push(doneCallback);
    }

    var externals = /*externals*/null; // The external libraries to install, injected below
    var func = /*user function*/null; // The user function or module to run, injected below

    var runUserFunction = function() {
        try {
            if (event.args) {
                func.apply(this, event.args);
            } else {
                func.apply(this, [event, context]);
            }
        } catch(error) {
            doneCallback(utils.objectifyError(error));
        }
    };

    try { externalsHandler.installExternals(externals, runUserFunction) }
    catch(error) { doneCallback(utils.objectifyError(error)) }
}
Raphaël Antonmattei
@rantonmattei
I've a PR out: mentum/lambdaws#63
Sylvain Perron
@slvnperron
@rantonmattei You are right about the events thing. Thanks a lot for the contribution. I’ll have a look later today!
Raphaël Antonmattei
@rantonmattei
@slvnperron I read your comments and made the requested changes.
Sylvain Perron
@slvnperron
@rantonmattei Awesome! PR merged
Gustav Svalander
@gurre
What AMI roles does lambdaws require more specifically? Needs to be added to the docs.
Sylvain Perron
@slvnperron
@gurre R/W SQS, Lambda full access
zulutune
@zulutune

Hey guys,
When I start a new process with require('child_process').spawn I always get "Spawn EACCES".
And when I use require('child_process').execFile, I get "Process exited before completing request".
According to the lambda docs, lambda supports creating processes, and have seen lots of examples doing that. I can't figure out what I am doing wrong. Have a stripped down, simple version which doesn't work either:

var path = require('path'),
      childProcess = require('child_process')
      , fs = require('fs');

exports.handler = function(event, context) {
  console.log('starting handler', event);

  var nodePath = path.join(__dirname, 'node');
  var nodeArgs = [path.join(__dirname, 'hello.js')];

  console.log('calling node: ', nodePath, nodeArgs);

  try {
    var proc = childProcess.spawn(nodePath, nodeArgs);

    proc.stdout.on('data', function (data) {
      console.log(data.toString('utf8'));
    });

    proc.stderr.on('data', function (data) {
      console.log('error  ---:> ' + data);
    });

    proc.on('exit', function (code) {
      console.log('child process exited with code ' + code);
      context.done();
    });

  } catch (e) {
    console.log(e);
    context.done(e, null);
  }


};

Anyone ideas?

I'm using node just as an example here, and it also doesn't work with other binaries.
The file is an executable: "-rwxr-xr-x@ 1 zulutune staff 20231104 Mar 24 03:08 node"
Sylvain Perron
@slvnperron
Hi @zulutune , thanks for your interest in Lambdaws.
Have you had a look into how we invoke external processes with lambdaws?
This works well for us
You may also have a look at Lambdash
Austen
@ac360
Anyone around?
EFF
@EFF
@ac360 sorry to be slow on the keyboard mate got some news ?
or questions ?
Austen
@ac360
@EFF Has anyone been able to connect to an external DB like MongoDB in a Lambda instance using Lambdaws? I'm trying to fire lambdaws with the 'mongodb' dependency and not having much luck.
EFF
@EFF
how do you specify your dependency ?
What do you mean by not having much luck ? Do you have any errors logs in your AWS cloudwatch console ?
Jacques-Olivier D. Bernier
@jackdbernier
@ac360 Just to be sure. Are you creating the db connection inside the function running on aws lambda?
Austen
@ac360
@EFF sorry I keep missing you
@jackdbernier sorry to miss you too!
I've put aside the mongoDB issue since I built an app that is using DynamoDB
It's something I've been wanting to work with and since Lambda has DynamoDB support out-of-the-box, I thought I'd build a simple app that uses it
However, I do have one new question
On the start of my node applciation, I'd like to upload the Lambda functions, in case any have changed
I have a directory entitled 'lambda' in my application