【问题标题】:Combining AWS step function task and map outputs in to one array将 AWS step function 任务和 map 输出组合到一个数组中
【发布时间】:2020-08-01 13:26:18
【问题描述】:

我有一个输出以下内容的任务状态:

"batch": {
    "batch": "size",
    "currentTimestamp": 1596205376
  },

地图状态输出一个数组:

"batch": [
    {
      "batch": "product-batch-0",
      "currentTimestamp": 1596205376
    },
    {
      "batch": "product-batch-1",
      "currentTimestamp": 1596205376
    }
]

我想将它们组合起来,以便地图状态之后的状态输入是这样的:

  "batch": [
    {
    "batch": "Size",
    "currentTimestamp": 1596205376
    },
    {
      "batch": "product-batch-22",
      "currentTimestamp": 1596205376
    },
    {
      "batch": "product-batch-8",
      "currentTimestamp": 1596205376
    }
]

这是否可以使用 aws step 函数中可用的输入/输出处理?我希望将它们包含在一个数组中,以便稍后在状态机中以其他映射状态一起处理它们。

【问题讨论】:

    标签: amazon-web-services aws-lambda aws-step-functions


    【解决方案1】:

    您应该使用另一个 Lambda 函数来合并输入和输出,因为步进函数输出功能无法将结果附加到数组或将输入和输出合并为数组。

    [1]:https://docs.aws.amazon.com/step-functions/latest/dg/input-output-resultpath.html#input-output-resultpath-append

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-03-27
      • 2021-09-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多