【问题标题】:AWS step function map task parametersAWS step function map 任务参数
【发布时间】:2021-05-21 17:39:02
【问题描述】:

我有一个带有地图任务的阶梯函数,众所周知,地图必须在 ItemsPath 中的数组上工作,我如何将整个输入传递给 lambda 而不仅仅是数组。

{"StartAt": "Find","States": {
"Find": {
  "Type": "Map",
   "MaxConcurrency": 0,
  "InputPath": "$",
  "ItemsPath": "$.Payload.contacts",
  "Iterator": {
     "StartAt": "func",
     "States": {
       "func": {
         "Type": "Task",
         
         "Resource": "arn:aws:lambda:us-east-1:....",
         "Parameters": {
        
           
            "Input": {
              "Payload":{
                "contact.$": "$"
              }
            }
          },
         "End": true
       }
     }
  },
  "ResultPath": "$.Input",
  "End": true
}}} ,

我希望在事件参数中传递整个输入

【问题讨论】:

    标签: amazon-web-services step


    【解决方案1】:

    如果您使用 Iterator,它会将 ItemsPath 中的值作为输入传递给 Lambda。您可以使用 Parameters 块将输入转换为 lambda 并添加整个输入。我自己没有尝试过,但我很确定应该这样做。

    https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-intrinsic-functions.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-06-10
      • 1970-01-01
      • 2021-09-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多