【问题标题】:Is it possible to dynamically update state inside a flow state within an AWS Step Function是否可以在 AWS Step Function 中动态更新流状态中的状态
【发布时间】:2022-11-03 16:08:37
【问题描述】:

我正在 Step Function 中实现choice loop,并尝试创建一些安全机制来防止意外发生太多循环。在文档中,他们建议创建一个 Lambda 来更新迭代/计数:

  let index = event.iterator.index
  let step = event.iterator.step
  let count = event.iterator.count
 
  index = index + step

我想知道是否有办法在 Step Function 中动态更新计数器,并避免需要额外的 Lambda?

【问题讨论】:

    标签: aws-step-functions


    【解决方案1】:

    现在可以使用新的 States.MathAdd 内在函数进行本机迭代:

    "counter.$": "States.MathAdd($.counter, 1)"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-05-15
      • 1970-01-01
      • 2020-03-30
      • 1970-01-01
      • 2020-07-26
      • 1970-01-01
      相关资源
      最近更新 更多