You want to send an SMS notification and also trigger a Lambda function whenever a message is published to an SNS topic. How should you configure the subscriptions?
hard📝 Best Practice Q15 of 15
AWS - SNS and SQS
You want to send an SMS notification and also trigger a Lambda function whenever a message is published to an SNS topic. How should you configure the subscriptions?
ACreate one subscription with protocol 'email' and endpoint as phone number, and another with protocol 'lambda' and endpoint as Lambda ARN.
BCreate one subscription with protocol 'sms' and endpoint as phone number, and another with protocol 'lambda' and endpoint as Lambda ARN.
CCreate one subscription with protocol 'lambda' and endpoint as phone number, and another with protocol 'sms' and endpoint as Lambda ARN.
DCreate one subscription with protocol 'sms' and endpoint as Lambda ARN, and another with protocol 'lambda' and endpoint as phone number.
Step-by-Step Solution
Solution:
Step 1: Understand protocol and endpoint matching
SMS protocol requires a phone number endpoint; Lambda protocol requires Lambda function ARN.
Step 2: Configure two subscriptions correctly
Create one subscription with protocol 'sms' and phone number endpoint, and another with protocol 'lambda' and Lambda ARN endpoint.
Final Answer:
Create one subscription with protocol 'sms' and endpoint as phone number, and another with protocol 'lambda' and endpoint as Lambda ARN. -> Option B
Quick Check:
Match protocol to correct endpoint type [OK]
Quick Trick:Match SMS to phone number, Lambda to function ARN [OK]
Common Mistakes:
Mixing endpoints and protocols
Using email protocol for SMS
Assigning Lambda ARN as SMS endpoint
Master "SNS and SQS" in AWS
9 interactive learning modes - each teaches the same concept differently