如何避免在AWS Step Function中同时执行 [英] How to avoid simultaneous execution in aws step function

查看:218
本文介绍了如何避免在AWS Step Function中同时执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前,我有一个用例,即云监视规则将每5分钟触发一次步进功能。如果要在步进功能中运行一个执行,我想有一个逻辑来跳过开始另一个执行。
可以这样做吗?

Currently I have a use case that a cloud watch rule will trigger a step function every 5 minutes. I want to have a logic to skip starting another execution if there is one execution already running in step function. Any way to do that?

推荐答案

您可以使CloudWatch事件规则直接触发Step Function,而不是让它触发Lambda函数。 Lambda函数可以通过 ListExecutions API 。否则,Lambda函数可以通过 StartExecution开始新的执行API

Instead of having your CloudWatch event rule trigger the Step Function directly, you could have it trigger a Lambda function. The Lambda function could check if there are any Step Function executions in the RUNNING state, via the ListExecutions API. If not, the Lambda function could start a new execution via the StartExecution API.

这篇关于如何避免在AWS Step Function中同时执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆