AWS SQS触发步骤功能 [英] AWS SQS trigger Step Functions

查看:266
本文介绍了AWS SQS触发步骤功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

快速问题:发送SQS消息后是否可以触发执行步进功能?如果是,您如何将其指定到cloudformation yaml文件中?

Quick question: Is it possible to trigger the execution of a Step Function after an SQS message was sent?, if so, how would you specify it into the cloudformation yaml file?

预先感谢。

推荐答案

首先要考虑的是:您真的吗? >是否需要使用SQS来启动Step Functions状态机?您可以使用API​​网关代替吗?或者,您可以将消息写入S3存储桶并使用CloudWatch事件启动状态机

The first think to consider is this: do you really need to use SQS to start a Step Functions state machine? Can you use API gateway instead? Or could you write your messages to a S3 bucket and use the CloudWatch events to start a state machine?

如果必须使用SQS,则需要具有lambda函数来充当状态机。代理。您需要将队列设置为lambda触发器,那么您将需要编写一个lambda来解析SQS消息并适当调用Step Functions StartExecution API

If you must use SQS, then you will need to have a lambda function to act as a proxy. You will need to set up the queue as a lambda trigger, and you will need to write a lambda that can parse the SQS message and make the appropriate call to the Step Functions StartExecution API.

我在移动设备上,所以我现在无法输入yaml,但是如果需要,我可以稍后再进行更新。现在,这里是有关如何从Lambda调用Step Functions状态机(包括示例yaml),这是如何使用CloudFormation设置SQS来触发Lambda

I’m on mobile, so I can’t type up the yaml right now, but if you need it, I can try to update with it later. For now, here is detailed walkthrough of how to invoke a Step Functions state machine from Lambda (including example yaml), and here is walkthrough of how to use CloudFormation to set up SQS to trigger a Lambda.

这篇关于AWS SQS触发步骤功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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