Skip to content

Conversation

@ned-kelly
Copy link

  • Previously it was not possible to call a lambda function while running serverless in "offline mode" from within the AWS SDK
  • This function adds support for the AWS SDK to 'invoke' the lambda function by specifying a "custom" endpoint (see example below):

Example of invoking a lambda function using this fix is as follows:

var AWS = require('aws-sdk');
AWS.config.region = 'us-east-1';

let lambda = new AWS.Lambda({
    region: 'us-east-1',
    endpoint: 'http://localhost:4000'
})

lambda.invoke({
    FunctionName: 'my-project-dev-myLambda', // the lambda function we are going to invoke
    Payload: JSON.stringify({
        "some-key": "some-value",
        "other-key": false
    })
}, function(err, data) {
    if (err) {
        console.error(err);
    } else {
        console.dir(data);
    }
})

@mattia85
Copy link

Hello authors,
do you think you'll merge this pull request in a short time?
Without this update it's not possible to invoke a lambda function using aws sdk.

Thanks

@ned-kelly
Copy link
Author

Hi @araptarchis - Any chance you can merge this in for the rest of the community?

Thanks,

@Raph22
Copy link

Raph22 commented Jul 30, 2019

Up. I need this too.

@ned-kelly
Copy link
Author

Hi Guys,

6 Months ago, i submitted a PR and it's not yet been merged....

I'm considering making my fork of this project a new project so the rest of the community can merge the other changes based on my fork... Any objections here?

I know that a lot of end-users are looking for this functionality to make it into the NPMJS project - Give me a thumbs-up if it's worth my time doing this and anyone else would benefit here?

Cheers,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants