我正在尝试创建一个AWS Step函数,但它在一个并行分支中显示了一条错误消息Field Parameters is not supported,处于选择状态。我使用了以下代码:
{
"Comment": "A Parallel Step Function",
"StartAt": "ParentStep",
"States":
{
"ParentStep":
{
"Comment": "Parallel test execution to check the Input Flow",
"Type": "Parallel",
"End": true,
"Branches":
[
{
"Comment": "Parallel Execution 1",
"StartAt": "branch1",
"States":
{
"branch1":
{
"Comment": "branch1 started",
"Parameters":
{
"testvalue1.$": "$.value1"
},
"Type": "Choice",
"Choices":
[
{
"Variable": "$.testvalue1",
"NumericEquals": 1,
"Next": "subbranch1"
},
{
"Not":
{
"Variable": "$.testvalue1",
"NumericEquals": 1
},
"Next": "subbranch2"
}
],
"Default": "subbranch2"
},
"subbranch1":
{
"Comment": "sub-branch 1",
"Type": "Pass",
"End": true
},
"subbranch2":
{
"Comment": "Ending branch 1",
"Type": "Pass",
"End": true
}
}
},
{
"Comment": "Parallel Execution 2",
"StartAt": "branch2",
"States":
{
"branch2":
{
"Comment": "starting branch 2",
"Parameters":
{
"testvalue2.$": "$.value2"
},
"Type": "Choice",
"Choices":
[
{
"Variable": "$.testvalue2",
"NumericEquals": 2,
"Next": "subbranch3"
},
{
"Not":
{
"Variable": "$.testvalue2",
"NumericEquals": 2
},
"Next": "subbranch4"
}
],
"Default": "subbranch4"
},
"subbranch3":
{
"Comment": "sub-branch 3",
"Type": "Pass",
"End": true
},
"subbranch4":
{
"Comment": "Ending Parallel Execution 2",
"Type": "Pass",
"End": true
}
}
}
]
}}}但是,如果我用Task状态替换Choice状态,同样的代码也可以工作。Choice状态下是否不支持字段Parameters?我浏览了AWS Step function文档,但看不到任何有关这方面的信息。谁能解释一下这件事?
谢谢
发布于 2021-07-08 13:51:25
不支持处于Choice状态的Parameters。根据this,您只能使用Choices和Default。此外,您还可以检查documentation支持哪些字段。顺便说一下,您可以通过以下解决方案来完成您的任务。
{
"Comment": "A Parallel Step Function",
"StartAt": "ParentStep",
"States": {
"ParentStep": {
"Comment": "Parallel test execution to check the Input Flow",
"Type": "Parallel",
"End": true,
"Branches": [
{
"Comment": "Parallel Execution 1",
"StartAt": "branch1",
"States": {
"branch1": {
"Comment": "branch1 started",
"Type": "Choice",
"Choices": [
{
"Variable": "$.testvalue1",
"NumericEquals": 1,
"Next": "subbranch1"
},
{
"Not": {
"Variable": "$.testvalue1",
"NumericEquals": 1
},
"Next": "subbranch2"
}
],
"Default": "subbranch2"
},
"subbranch1": {
"Comment": "sub-branch 1",
"Type": "Pass",
"Parameters": {
"testvalue1.$": "$.value1"
},
"End": true
},
"subbranch2": {
"Comment": "Ending branch 1",
"Type": "Pass",
"Parameters": {
"testvalue1.$": "$.value1"
},
"End": true
}
}
},
{
"Comment": "Parallel Execution 2",
"StartAt": "branch2",
"States": {
"branch2": {
"Comment": "starting branch 2",
"Type": "Choice",
"Choices": [
{
"Variable": "$.testvalue2",
"NumericEquals": 2,
"Next": "subbranch3"
},
{
"Not": {
"Variable": "$.testvalue2",
"NumericEquals": 2
},
"Next": "subbranch4"
}
],
"Default": "subbranch4"
},
"subbranch3": {
"Comment": "sub-branch 3",
"Type": "Pass",
"Parameters": {
"testvalue2.$": "$.value2"
},
"End": true
},
"subbranch4": {
"Comment": "Ending Parallel Execution 2",
"Type": "Pass",
"Parameters": {
"testvalue2.$": "$.value2"
},
"End": true
}
}
}
]
}
}
}https://stackoverflow.com/questions/68290471
复制相似问题