(stepfunctions-tasks): LambdaInvoke - explicit null is not passed to lambda when using
See original GitHub issueWhen 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:
- Created 2 years ago
- Reactions:2
- Comments:10 (6 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@kaizen3031593 - I am actively working on a fix for this. Can you assign this issue to me?
Is this fixed? We also facing this issue.