Bird
0
0

You wrote this code to subscribe an SMS endpoint but get an error:

medium📝 Debug Q6 of 15
AWS - SNS and SQS
You wrote this code to subscribe an SMS endpoint but get an error:
sns_client.subscribe(TopicArn='arn:aws:sns:us-east-1:123456789012:MyTopic', Protocol='sms', Endpoint='1234567890')

What is the likely cause?
AThe Endpoint parameter should be an email.
BThe phone number is missing country code format.
CThe TopicArn is invalid.
DThe protocol 'sms' is not supported.
Step-by-Step Solution
Solution:
  1. Step 1: Check SMS Endpoint Format Requirements

    SMS endpoints require phone numbers in E.164 format, including country code (e.g., +1234567890).
  2. Step 2: Identify Cause of Error

    Number '1234567890' lacks country code, causing subscription failure.
  3. Final Answer:

    The phone number is missing country code format. -> Option B
  4. Quick Check:

    SMS endpoint needs country code [OK]
Quick Trick: Use E.164 format with country code for SMS endpoints [OK]
Common Mistakes:
  • Using local phone number without country code
  • Thinking 'sms' protocol is unsupported
  • Confusing endpoint type with email

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes