我需要在我的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.
有什么想法吗?感激
要让SNS触发Lambda,Lambda需要订阅SNS的主题。您可以参考此doc,以在发布到SNS主题的消息时触发Lambda。