I have a lambda that produces an array of json objects. I want the lambda result passed to a step function under a given attribute name.
Input to task that runs lambda:
{
"foo": "abc",
"bar": "def"
}
Output I want
{
"foo": "abc",
"bar": "def",
"lambdaOutput": [
{...},
{...}
]
}
I thought ResultSelector + ResultPath is supposed to solve this problem but I am stuck. I tried
"ResultSelector": {
"lambdaOutput.$": "$.Payload",
},
"ResultPath": "$.lambdaOutput"
But this just creates a nested structure
{
"foo": "abc",
"bar": "def",
"lambdaOutput":
"lambdaOutput: {
[
{...},
{...}
]
}
}
What am i missing?
Not sure how to do it from console, but from CDK, you can specify payloadResponseOnly