Home > OS >  AWS SNS , two lambda subscription problem
AWS SNS , two lambda subscription problem

Time:07-12

  1. How to use same sns for two lambda from code point of view. Should I check for the filter in the event body and ask the particular lambda to act if it matches?

  2. How does the subscription work? whn two subscribers are there how does the sns know what it is sending and where it is sending?

CodePudding user response:

You should create two subscriptions, one for each Lambda, and add a subscription filter so the corresponding Lambda is triggered for the adequate message.

Check the docs about Subscription filter policy: https://docs.aws.amazon.com/sns/latest/dg/sns-message-filtering.html#message-filtering-example-policy

  • Related