question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

serverless invoke local with clientContext

See original GitHub issue

This is a Feature Proposal

Description

When running “invoke local” I would need the addition to include clientContext. In our Lambdas we are using clientContext to provide additional/routing information that is needed for our Lambdas to run.

It is great that we can supply the event when testing/running locally with the --path flag but in addition to the event we would need to supply the handlers context as well.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
horike37commented, Aug 4, 2017

What about adding --context flag to invoke local ?

For example:

$ sls invoke local -f hello --context '{"functionName":"hello","clientContext":....}'

and

$ sls invoke local -f hello --context-path context.json
3reactions
RafalWilinskicommented, Aug 4, 2017

Looks nice, I can try implementing that. cc @horike37 @pmuens

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I include clientContext for AWS Lambda "sls invoke ...
Running sls invoke local --function myFunc --path ./my/event.json is a great function but I now have need of providing clientContext to my ...
Read more >
Lessons learned experimenting with an AWS Lambda ...
The basic premise is that the API for invoking a Lambda function provides the ability to include a ClientContext — a dictionary of...
Read more >
invoke — AWS CLI 1.27.37 Command Reference
Invokes a Lambda function. You can invoke a function synchronously (and wait for the response), or asynchronously. To invoke a function asynchronously, ...
Read more >
Executing and Invoking Lambda Function - Tutorialspoint
--client-context − You can pass client specific details to the Lambda function. The clientcontext has to be in json format and base64-encoded. Maximum...
Read more >
Serverless Lambda invoking Lambda. Getting no errors but a ...
I am getting in local the same error I was getting remote. I think now is better. At least I can see the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found