1 Answer
- Newest
- Most votes
- Most comments
0
If you invoke your lambda function from SFN using the full function ARN in the Resource attribute, you will get back only what was returned from the Lambda function. Also, you do not want to json.dump the object that you return. Just return a map and that will be included in your output.
For instance, the following function:
def lambda_handler(event, context):
# TODO implement
body = {
'Test': 'abc',
'Value': 123
}
return body
When invoked like this:
"Hello": {
"Type": "Task",
"Resource": "arn:aws:lambda:eu-west-1:xxxxxxxxx:function:HelloWorld:$LATEST",
"ResultPath": "$.LambdaResult",
"Next": "World"
},
With the following input:
{
"Input": "My input"
}
returned the following:
{
"Input": "My input",
"LambdaResult": {
"Test": "abc",
"Value": 123
}
}
Relevant content
- Accepted Answerasked 2 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago