问题
Can we subscribe an Amazon SNS topic using an AWS Lambda function?
回答1:
Yes. With help of sns.subscribe()
Please keep in mind: dont forget to confirm it sns.confirmSubscription()
回答2:
If you mean can you use a message from a SNS topic as the trigger for a lambda function, then the answer is yes.
If you mean can you write a lambda function that adds a subscription to an SNS topic then the answer is yes. Towards the bottom are links for the language-specific AWS SDKs. Your Lambda function would need to have the appropriate permissions to be able to add a subscription as well.
来源:https://stackoverflow.com/questions/44545695/subscribe-an-amazon-sns-topic-using-aws-lambda-function