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.

(stepfunctions-tasks): LambdaInvoke - explicit null is not passed to lambda when using

See original GitHub issue

When I try to pass null as some parameter of a lambda, it gets removed from resulting task’s parameters.

It might have same result for javascript lambdas, but in Python there is a difference between key not being in input event and key being there with value null (or None in Python’s case).

This issue can be worked around by adding additional checks in the lambda, but that would add additional step needed for migration to CDK.

Reproduction Steps

from aws_cdk import aws_lambda
from aws_cdk import aws_stepfunctions
from aws_cdk import aws_stepfunctions_tasks


some_lambda = aws_lambda.Function.from_function_arn(scope, 'SomeLambda', 'arn:aws:lambda:eu-central-1:123456789:function:some-lambda')

aws_stepfunctions_tasks.LambdaInvoke(
    scope,
    'Lambda',
    lambda_function=some_lambda,
    payload=aws_stepfunctions.TaskInput.from_object({
        'nullParameter': None,
        'notNullParameter': 'not null'
    }),
    payload_response_only=True,
    retry_on_service_exceptions=False
)

What did you expect to happen?

{
    "Type": "Task",
    "Resource": "arn:aws:lambda:eu-central-1:123456789:function:some-lambda",
    "Parameters": {
        "nullParameter": null,
        "notNullParameter": "not null"
    }
}

What actually happened?

{
    "Type": "Task",
    "Resource": "arn:aws:lambda:eu-central-1:123456789:function:some-lambda",
    "Parameters": {
        "notNullParameter": "not null"
    }
}

Environment

  • CDK CLI Version :1.118.0
  • Framework Version:???
  • Node.js Version:v15.14.0
  • OS :Ubuntu 18.04.5 LTS
  • Language (Version):Python 3.7.4

Other


This is 🐛 Bug Report

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:2
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
jaresuthcommented, Sep 28, 2021

@kaizen3031593 - I am actively working on a fix for this. Can you assign this issue to me?

0reactions
krish00backcommented, Jun 25, 2022

Is this fixed? We also facing this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

class LambdaInvoke (construct) · AWS CDK
Lambda function to invoke. clientContext? string, Up to 3583 bytes of base64-encoded data about the invoking client to pass to the function.
Read more >
Step Function: Data is not passed to next Lambda function's ...
Testing with the Lambda console test function shows that {iteration:1} is correctly returned as the return value of lambda function. The lambda ......
Read more >
5 Steps to Serverless Security With the AWS Lambda Plugin
This is clear when we use the AWS CLI to try to invoke our Lambda function without any credentials: $ aws lambda invoke...
Read more >
SQS and Lambda: a Quick Tutorial and How to Handle Failure ...
Learn how to use SQS with Lambda to save time and handle events ... There is no need to explicitly configure these steps...
Read more >
How do I troubleshoot HTTP 403 Forbidden errors ... - YouTube
Skip directly to the demo: 0:32For more details see the Knowledge Center article with this video: ...
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