Amazon SNS to easily push real-time notification messages to interested subscribers over multiple delivery protocols

Connecting to SNS from Python Code (using boto3)

For topic and subscribe model, all those who subscribe to the topic need to accept the subscription. Need to confirm via email and there is an OTP via message.

Connect to SNS

Setting the topic

  1. Create Topic
  2. Choose Standard and set Name of topic
  3. Set Topic Subscription
  4. Take note of the ARN

Subscribing

Emails

  1. email needs to subscribe to topic using ARN
  2. publish to topic

SMS

  1. SMSes need to be added to the sandbox to receive notification
  2. Publish
    1. Publish via phone no - 1 no
      • Code
    2. Publish via topic using topic ARN
      • Code

Resource

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sns.html?highlight=sns#SNS.Client.verify_sms_sandbox_phone_number