AWS:Lambda:以编程方式添加SNS触发器

问题描述 投票:0回答:1

我需要在我的lambda函数中添加基于'SNS'的触发器,但是下面的链接仅显示了DynamoDB,Kinesis,SQS。https://docs.aws.amazon.com/cli/latest/reference/lambda/create-event-source-mapping.html?highlight=lambda%20trigger%20event%20source%20mapping

The

"aws lambda create-event-source-mapping" command for SNS, S3 etc based triggers fails with --event-source-arn 

as

An error occurred (InvalidParameterValueException) when calling the CreateEventSourceMapping operation: Unrecognized event source, must be kinesis, dynamodb stream or sqs. Unsupported source arn
However these can be accomplished through AWS console.

有什么想法吗?感激

amazon-web-services events lambda command-line-interface
1个回答
0
投票

要让SNS触发Lambda,Lambda需要订阅SNS的主题。您可以参考此doc,以在发布到SNS主题的消息时触发Lambda。

最新问题
© www.soinside.com 2019 - 2024. All rights reserved.