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.

Input not passed to Lambda functions

See original GitHub issue

Love the idea behind this project and have been trying to incorporate it into one of my apps that uses step functions so I can test 100% locally. I’ve been able to:

  1. Create step function state machines locally.
  2. Execute the state machine, passing some JSON as input.
  3. When the state machine hits a Task with a Lambda function, I’ve been able to use --lambda-endpoint option to have it call a mock lambda server I’m running locally.

The gotcha is that my mock lambda server gets the POST… But the body contains an empty JSON input: {}. For some reason, the original JSON input I passed in is dropped. Any ideas what I’m doing wrong?

Issue Analytics

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

github_iconTop GitHub Comments

brikis98commented, Nov 25, 2018

Scratch that, I was wrong. stepfunctions-local sends the input along just fine. The problem is AWS itself plus the web framework I was using with Node. In particular:

  1. AWS does not set a Content-Type header when it invokes a Lambda function.
  2. My Node.js web framework, for some reason, doesn’t read in the request body when Content-Type is not set, and, confusingly, just gives you an empty {} body instead.
marlonbernardescommented, Dec 19, 2019

Exactly my issue - thanks for sharing the root cause here, @brikis98. It would have taken me much longer to figure this out if not for your comment!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to pass custom values to AWS Lambda function
I am trying to pass custom input to my lambda function (Python 3.7 runtime) in JSON format from the rule set in CloudWatch....
Read more >
Lambda Function Input Event and Response Format
The following shows the general format of an Amazon Lex event that is passed to a Lambda function. Use this information when you...
Read more >
Passing input through API Gateway to your Lambda Functions
GitHub: Online Training Registration form: Online training, connect us on ...
Read more >
Validating Input Parameters in A Lambda Function - Medium
I will only execute the code if the value passed in matches one of our defined batch job names. I'll return a message...
Read more >
How do you pass input to a lambda function? - Quora
If you mean AWS Lambda, then the input is part of the event that triggers the lambda function to execute. If it's triggered...
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 Post

No results found

github_iconTop Related Hashnode Post

No results found