Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon web services 如何将参数传递给映射任务中的所有内部工作流任务?_Amazon Web Services_Aws Step Functions - Fatal编程技术网

Amazon web services 如何将参数传递给映射任务中的所有内部工作流任务?

Amazon web services 如何将参数传递给映射任务中的所有内部工作流任务?,amazon-web-services,aws-step-functions,Amazon Web Services,Aws Step Functions,我试图在我的状态机中使用映射任务。设计很简单-我有一个lambda函数,它生成映射状态使用的列表。映射任务中的每个任务都应该可以访问列表的属性 现在我注意到只有第一个任务“ETL”将每个列表元素作为输入,而不是第二个任务“WELL CALC” 我的踏步机出故障了 { "error": "States.Runtime", "cause": "An error occurred while executing the s

我试图在我的状态机中使用映射任务。设计很简单-我有一个lambda函数,它生成映射状态使用的列表。映射任务中的每个任务都应该可以访问列表的属性

现在我注意到只有第一个任务“ETL”将每个列表元素作为输入,而不是第二个任务“WELL CALC”

我的踏步机出故障了

{
  "error": "States.Runtime",
  "cause": "An error occurred while executing the state 'WELL CALC' (entered at the event id #15). The JSONPath '$.basinName' specified for the field 'basin.$' could not be found in the input '{}'"
}
如果上述错误为真,ETL lambda任务的结果将返回一个空对象。是否有一种方法可以将映射迭代的“当前项”作为输入传递给所有任务

这是我的状态机定义:

{
  "StartAt": "Generate Basin List",
  "States": {
    "Generate Basin List": {
      "Type": "Task",
      "Resource": "arn:aws:lambda:us-east-1:451713003466:function:StepFunctionsSample-HelloLam-CheckStockPriceLambda-15TO7SRHAQYQV",
      "Next": "Process Basins"
    },
    "Process Basins": {
      "Type": "Map",
      "ItemsPath": "$.BasinList",
      "End": true,
      "Iterator": {
        "StartAt": "ETL",
        "States": {
          "ETL": {
            "Type": "Task",
            "Resource": "arn:aws:lambda:us-east-1:451713003466:function:StepFunctionsSample-HelloLambda0b4d-BuyStockLambda-1WW8B8JQSZ0SY",
            "Next": "WELL CALC"
          },
          "WELL CALC": {
            "Type": "Task",
            "End": true,
            "Parameters": {
              "basin.$":"$.basinName",
              "phases.$":"$.phases"
            },
            "Resource": "arn:aws:lambda:us-east-1:451713003466:function:StepFunctionsSample-HelloLambda0b4-SellStockLambda-15I8EE3RWDMS5"
          }
        }
      }
    }
  }
}
这是“生成盆地列表”lambda:


事实证明,我可以将
“ResultPath”:null
字段添加到映射内的第一个状态-
ETL
,这将导致整个输入状态作为输出传递到下一个状态(源-):

exports.lambdaHandler = async (event, context) => {
    return {
        "BasinList": [
            {
                "basinName": "ARDMORE_AND_MARIETTA_BASINS",
                "phases": "1,4,5,8,9,10,13"
            }
        ]
        }
};
...
"ETL": {
    "Type": "Task",
    "Resource": "arn:aws:lambda:us..."
    "Next": "WELL CALC",
    "ResultPath": null
},
...