0
0
AWScloud~10 mins

SNS notification types (email, SMS, Lambda) in AWS - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - SNS notification types (email, SMS, Lambda)
SNS Topic Created
Subscribe Email
Subscribe SMS
Email Endpoint
Publish Message to Topic
SNS Sends Notification to All Subscribers
Email Received, SMS Received, Lambda Invoked
SNS topic has subscribers of different types (email, SMS, Lambda). When a message is published, SNS sends notifications to all subscribers according to their type.
Execution Sample
AWS
Create SNS topic
Subscribe email endpoint
Subscribe SMS number
Subscribe Lambda function
Publish message to topic
This sequence creates an SNS topic, adds email, SMS, and Lambda subscribers, then publishes a message triggering notifications.
Process Table
StepActionTargetResultNotification Sent
1Create SNS TopicMyTopicTopic CreatedNo
2SubscribeEmail user@example.comSubscription Pending ConfirmationNo
3SubscribeSMS +1234567890Subscription ConfirmedNo
4SubscribeLambda Function ARNSubscription ConfirmedNo
5Email User Confirms Subscriptionuser@example.comSubscription ConfirmedNo
6Publish MessageMyTopicMessage PublishedYes: Email, SMS, Lambda
7SNS Sends Emailuser@example.comEmail DeliveredYes
8SNS Sends SMS+1234567890SMS DeliveredYes
9SNS Invokes LambdaLambda FunctionLambda ExecutedYes
10End-All Notifications SentNo
💡 All subscribers confirmed and message published; notifications sent to all.
Status Tracker
VariableStartAfter Step 2After Step 3After Step 4After Step 5After Step 6Final
SNS TopicNoneCreatedCreatedCreatedCreatedCreatedCreated
Email SubscriptionNonePendingPendingPendingConfirmedConfirmedConfirmed
SMS SubscriptionNoneNoneConfirmedConfirmedConfirmedConfirmedConfirmed
Lambda SubscriptionNoneNoneNoneConfirmedConfirmedConfirmedConfirmed
Message PublishedNoNoNoNoNoYesYes
Notifications SentNoNoNoNoNoYesYes
Key Moments - 3 Insights
Why does the email subscription show 'Pending' before confirmation?
Email subscriptions require the user to confirm by clicking a link. Until confirmed (see Step 5), SNS does not send notifications to that email.
Why are SMS and Lambda subscriptions confirmed immediately?
SMS and Lambda subscriptions do not require user confirmation, so SNS marks them as confirmed right after subscription (Steps 3 and 4).
When does SNS send notifications to subscribers?
SNS sends notifications only after a message is published to the topic and the subscriber is confirmed (Step 6 triggers sending in Steps 7-9).
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, what is the status of the email subscription at Step 3?
AConfirmed
BNone
CPending Confirmation
DUnsubscribed
💡 Hint
Check the 'Result' column at Step 3 in the execution_table.
At which step does SNS send notifications to all subscribers?
AStep 6
BStep 5
CStep 7
DStep 10
💡 Hint
Look for 'Message Published' and 'Notifications Sent' in the execution_table.
If the email user never confirms subscription, what changes in the execution table?
AEmail subscription becomes 'Confirmed' automatically
BEmail subscription stays 'Pending', no email sent
CSNS sends email anyway
DLambda subscription fails
💡 Hint
Refer to the 'Email Subscription' variable in variable_tracker and Step 5 in execution_table.
Concept Snapshot
SNS Topic holds subscribers of types: Email, SMS, Lambda.
Email requires user confirmation before receiving messages.
SMS and Lambda subscriptions confirm immediately.
Publishing a message sends notifications to all confirmed subscribers.
SNS handles delivery according to subscriber type.
Full Transcript
This visual execution traces how AWS SNS handles different notification types: email, SMS, and Lambda. First, an SNS topic is created. Then, subscribers are added: an email address, a phone number for SMS, and a Lambda function. Email subscriptions require the user to confirm by clicking a link, so initially, the email subscription is pending. SMS and Lambda subscriptions confirm immediately. When a message is published to the topic, SNS sends notifications only to confirmed subscribers. The email user receives an email after confirmation, SMS receives a text message, and the Lambda function is invoked. This process ensures reliable delivery tailored to each subscriber type.