Skip to content

AWS SNS service

0

How can I use AWS SNS service to send SMS to specific numbers ?

asked 3 years ago415 views

4 Answers
2

If you would like to send SMS from AWS SNS, for one of the use-cases that this is supported for, then you first need to purchase an AWS SNS Origination Identity from AWS.

These case be either a Sender ID (and Alphanumeric Name - supported in some countries) or an orgination number.

To learn how to do this, and then send SMS messages with SNS - read https://docs.aws.amazon.com/sns/latest/dg/sns-mobile-phone-number-as-subscriber.html

AWS
EXPERT

answered 3 years ago

EXPERT

reviewed 3 years ago

EXPERT

reviewed 3 years ago

2

Hi,

Take a look at the following AWS documentation which describes how to send SMS messages directly to a mobile phone without subscribing the phone number to an Amazon SNS topic.

EXPERT

answered 3 years ago

EXPERT

reviewed 3 years ago

AWS
EXPERT

reviewed 3 years ago

EXPERT

reviewed 3 years ago

0

Create an SMS message template for each type of message that you plan to send

answered 3 years ago

0

AWS SNS (Amazon Simple Notification Service) is a fully managed messaging service provided by Amazon Web Services (AWS) that enables you to send notifications or messages between distributed systems, microservices, or to end users via different protocols. Steps to Send SMS with AWS SNS 1. Enable SMS in AWS SNS Go to AWS SNS Console → Text messaging (SMS) section. Check your spending limit (by default it’s very low, like $1/month). If you want to use SMS in production, you need to click Request spending limit increase. Choose "AP-Northeast-2 (Seoul)" as the region. Select the destination country (Korea = +82).

2. Verify SMS settings In AWS SNS Console → Text messaging (SMS) → Preferences: Default message type: Transactional (for alerts/critical messages). Monthly spend limit: Increase from $1 to your required budget. Delivery status logging: (optional, for CloudWatch logs).

3. IAM Permissions **4. Python Boto3 Code (ap-northeast-2, Korea) **-if using python import boto3

def send_sms(phone_number, message): sns = boto3.client("sns", region_name="ap-northeast-2") # Seoul region response = sns.publish( PhoneNumber=phone_number, Message=message, MessageAttributes={ 'AWS.SNS.SMS.SMSType': { 'DataType': 'String', 'StringValue': 'Transactional' # or 'Promotional' } } ) return response

if name == "main": phone = "+82....." # Korean number, must include +82 msg = "🚨 Alert: Test SMS from AWS SNS" result = send_sms(phone, msg) print(result) Also you can test using aws pinpoint console

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.