我正在尝试弄清楚如何将多个输入传递到我的 ARN。然而,我似乎不能那样做。
下面是我的机器规范
{
"StartAt": "DemoStateFunction",
"Version": "1.0",
"States": {
"DemoStateFunction": {
"Type": "Task",
"Resource": "ARN-Demo-Function",
"InputPath": "$.demostate1",
"Next": "DemoStateFunction2"
},
"DemoStateFunction2": {
"Type": "Task",
"Resource": "ARN-Demo-Function",
"InputPath": "$.demostate2",
"End": true
}
}
}
这是我的输入
{
"demostate1": {
"data": "john",
},
"demostate2": {
"data": "doe"
}
}
执行此任务时。它成功地检索了我的 demonstate1 数据,但是它似乎看不到我在“TaskStateEntered”步骤中看到的 demostate2。
最佳答案
机器状态数据从一种状态传递到另一种状态。
如果您从任务返回数据并且没有在您的状态上指定 ResultPath
属性,则任务的输出将成为下一个状态的输入。这是您的 demostate2
丢失的地方。
the task results are sent along as the state's output (which becomes the input for the next task).
因此,您需要通过在您的 DemoStateFunction
状态上使用类似这样的内容,将 DemoStateFunction
的结果合并到输入数据中:
"DemoStateFunction": {
"Type": "Task",
"Resource": "ARN-Demo-Function",
"InputPath": "$.demostate1",
"ResultPath": "$.demooutput1",
"Next": "DemoStateFunction2"
},
这会获取任务的结果并将其合并到 demooutput1
属性下的现有输入结构中。
关于amazon-web-services - 如何将输入传递给多个 ARN(aws step 函数)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47927312/