In another question, I asked how I can include the executionId of a step function workflow as part of the input to my Lambda function, and this was the solution:
new tasks.LambdaInvoke(this, "InvokeLambdaTask", {
lambdaFunction: myLambda,
payload: sfn.TaskInput.fromObject({
executionId: sfn.JsonPath.stringAt("$$.Execution.Id"),
}),
})
This works wonderfully.
However, previously, I was leaving my payload unspecified, so I would get my entire InputPath as the payload. I would like to still have my entire InputPath as my payload, but with the addition of the executionId.
I am trying to avoid redundantly specifying each field,
new tasks.LambdaInvoke(this, "InvokeLambdaTask", {
lambdaFunction: myLambda,
payload: sfn.TaskInput.fromObject({
executionId: sfn.JsonPath.stringAt("$$.Execution.Id"),
foo: sfn.JsonPath.stringAt("$.foo"),
bar: sfn.JsonPath.stringAt("$.bar"),
...
}),
})
I'm not sure how to express this in CDK/JsonPath in a concise way. I've tried a variety of approaches based on answers to related questions that don't work and probably don't even make sense, like ".$": sfn.JsonPath.stringAt("$")