简体   繁体   中英

AWS Step Functions - include all step input but add a parameter

Let's say I have an AWS step function that simply passes the output from the first step to the second step. But now let's say I need to add an additional input value for that second step.

How do I set the parameters for the second step to keep ALL input fields (without specifying them individually) and add a new input value?

The closest I can get is setting the Parameters like this:

"Second Step": {
  "Type": "Task",
  "Resource": "arn:aws:lambda:blahblahblah",
  "InputPath": "$",
  "Parameters": {
    "Input.$":"$",
    "additionalValue": "ABC"
  }
}

But that results in pushing all of the input values under that new "Input" key, where I really just want them in the root of the dictionary. I could swear there was some magic expression I saw once that made this work the way I want it to, but now I can't find it.

AWS now has a simulator you can try this in . Set InputPath to $ and Parameters to {"Input.$":"$","additionalValue":"ABC"} to see an example of this situation.

You can have this kind of manipulation with ResultSelector . But it can only be applied at ouput step. With this approach you need to either

  • Alter the output of previous step with ResultSelector
  • Create a pass-through step that add the static additional value you wanted

同样,我想在每次尝试中访问 RetryCount,但找不到结合 RetryCount 和其他输入的好方法

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM