AWS Feed
Introducing the SMS sandbox for Amazon SNS
This post is written by Hardik Vasa, Sr. Cloud Support Eng., and Sarath Kumar Kallayil Sreedharan, Sr. Cloud Support Eng.
Amazon SNS customers can now more safely and effectively ramp up their usage of SMS messaging via the SMS sandbox. In this post, I describe the SMS sandbox, how it works, and how you can benefit from it.
Overview
SNS provides application-to-person (A2P) and application-to-application (A2A) notification services. In A2P scenarios, you use SNS to deliver application alerts and notifications to your customers across different channels, including SMS text messaging.
You can use SNS to send SMS either directly to a phone number or to multiple phone numbers by using topics. SNS supports the delivery of SMS messages to mobile phone numbers in more than 200 countries.
The SMS sandbox protects your reputation as a sender. It guides you through the process of provisioning dedicated SMS origination numbers in your AWS account. New AWS accounts are placed in the SMS sandbox by default. While your account is in the SMS sandbox, you can send SMS messages to verified recipients, for development and testing purposes. The following quotas apply:
- You can send a maximum of 20 SMS messages per second.
- You can send SMS messages to a maximum of 10 verified destination phone numbers.
To move to production, request to leave the SMS sandbox by contacting AWS Support. As part of your request, you must provision the resources needed to operate in the country where you want to send SMS messages.
For example, to send SMS messages to US phone numbers, you must have an SMS origination number (that is, 10DLC, toll-free number, or short code) associated with your AWS account. Once approved by AWS, you can send SMS messages globally to unverified destination phone numbers. You can also increase your SMS publish and monthly spend quotas.
Using the sandbox console
To get started with the SMS sandbox, navigate to the SNS console, and select Text messaging (SMS) from the navigation panel.
On this page, you can review account status information, destination phone numbers, and origination identities, among other details.
Adding a destination phone number
For sending SMS messages to Sandbox destination phone numbers in countries where origination identities are required, you must purchase an origination identity.
For example, in the US, you must have at least one valid origination number (that is, 10DLC, toll-free, or short code) before you can send messages successfully. For more information, see Requesting phone numbers in the Amazon SNS Developer Guide.
To add a new number to the Sandbox destination phone numbers list, choose Add Phone Number. Enter the phone number in E.164 format, specify what language to use for the verification message, and choose Add Phone Number.
Verifying a destination phone number
To start using a destination number, first verify that you have access to that number. Once you add a phone number, SNS sends a one-time password (OTP), to the destination phone number. This OTP is valid for 15 minutes.
Once you enter the OTP, choose Verify phone number. SNS then updates the Sandbox destination phone numbers section with the phone number that you registered, along with its status.
If the OTP message does not arrive to the phone number specified, you can choose Resend verification code from the console. It may take a few minutes for the OPT message to arrive. You can request the verification code only five times in a 24-hour period per number.
If you have entered a valid OTP, the destination phone number is marked as Verified. Otherwise, the phone number is marked as Pending. You can check the status of each destination number in the SNS console. While in the sandbox, you can only send SMS messages to verified phone numbers.
Publishing to a destination phone number
After verifying the phone number, you can start publishing SMS messages to that number. To publish a message via the SNS console:
- Choose Publish text message from the Text messaging (SMS) page.
- In the Publish SMS message page, under Details:
- Choose the Message type
- Choose a verified Destination phone number
- Type up your Message
- Then, under Origination identities:
- Choose an Origination number based on the destination country
- Choose Publish message.
The SNS console shows you a confirmation message.
Deleting a destination phone number
To delete a phone number via the SNS console:
- Navigate to the Sandbox destination phone numbers section
- Choose the phone number that you would like to delete
- Choose Delete Phone Number
- From the pop-up window, type delete me, and choose Delete.
The number is removed from the verified destination phone numbers list.
You can only delete destination phone numbers after 24 hours since the last verification attempt.
Using the sandbox API
In addition to using the AWS Management Console, with the launch of the SMS sandbox, SNS introduces additional API actions for programmatic access to SMS sandbox operations, which you can call via the AWS Command Line Interface (CLI) and AWS SDKs.
These API actions include:
- CreateSMSSandboxPhoneNumber
- DeleteSMSSandboxPhoneNumber
- GetSMSSandboxAccountStatus
- ListOriginationNumbers
- ListSMSSandboxPhoneNumbers
- VerifySMSSandboxPhoneNumber
Moving out of the sandbox
To exit the sandbox environment from an AWS Region, submit a request to AWS Support. Once the request is reviewed and approved by AWS, your account is moved to production. You can check the status of your account in the SNS console.
Conclusion
This post describes the SMS sandbox in SNS. It shows how you can configure the SMS sandbox features, quotas, and how you can move out of the sandbox.
There are no added fees associated with the SMS sandbox, and there is no change in the cost of sending SMS messages using the sandbox. The one-time-password (OTP) text messages sent during the verification process are charged at the regular transactional text message rates of SNS.
For additional details on pricing, see Worldwide SMS pricing. For additional details on programmatic access to the sandbox, see Actions in the Amazon SNS API Reference. For more information on 10DLC, see the Provisioning and using 10DLC origination numbers with Amazon SNS blog post. To get started with the SMS sandbox, navigate to the SNS console.
For more serverless learning resources, visit Serverless Land.