调用多个AWS Lambda函数

调用多个AWS Lambda函数

问题描述:

我们如何才能一个接一个地调用多个AWS Lambda函数?例如,如果一个AWS Lambda链由8个独立的lambda函数组成并且每个模拟一个1秒的处理事件,然后调用下一个函数在链中.

How can we invoke multiple AWS Lambda functions one after the other ?For example if an AWS Lambda chain consists of 8 separate lambda functions and each simulate a 1 sec processing event and then invoke the next function in the chain.

我不建议使用直接invoke启动功能.相反,您应该考虑创建SNS Topic并将Lambda函数订阅该主题.将消息发布到您的主题后,所有功能将同时启动.该解决方案也易于扩展.

I wouldn't recommend using direct invoke to launch your functions. Instead you should consider creating an SNS Topic and subscribing your Lambda functions to this topic. Once a message is published to your topic, all functions will fire at the same time. This solution is also easily scalable.

在官方文档中查看更多信息使用Amazon SNS调用Lambda函数通知

See more information at official documentation Invoking Lambda functions using Amazon SNS notifications