Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS StepFunction CDK resultpath set to null

I am not able to find a way to specify 'null' to result path.

As pointed out here: https://docs.aws.amazon.com/step-functions/latest/dg/input-output-resultpath.html

I want to implement, in CDK, this: "Discard the Result and Keep the Original Input"

I have read this discussion: https://github.com/aws/aws-cdk/issues/1805

but there is no final answer although it has been closed. Below a code snip:

const verifyDeviceJob = new tasks.LambdaInvoke(this, 'VerifyDeviceJobTask', {
      lambdaFunction: verifyConditionDeviceFn,
      inputPath: '$.detail',      
      resultPath: //HOW TO DECLARE IT TO NULL??
});
like image 483
Marco Sinigaglia Avatar asked Aug 29 '26 17:08

Marco Sinigaglia


1 Answers

You use special value DISCARD https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-stepfunctions.JsonPath.html#static-discard

So the snip would be like

const verifyDeviceJob = new tasks.LambdaInvoke(this, 'VerifyDeviceJobTask', {
      lambdaFunction: verifyConditionDeviceFn,
      inputPath: '$.detail',      
      resultPath: JsonPath.DISCARD
});
like image 57
Milan Gatyas Avatar answered Sep 04 '26 00:09

Milan Gatyas