BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Amazon Simple Notification Service (SNS) Gains Worldwide SMS Delivery

Amazon Simple Notification Service (SNS) Gains Worldwide SMS Delivery

Amazon's Simple Notification Service (SNS) recently gained worldwide SMS delivery and can now be used in five additional Amazon Web Services (AWS) regions. AWS also added several new features such as opt-out management, direct publishing, delivery status monitoring, and spending limits.

AWS describes Amazon SNS as a "fast, flexible, fully managed push notification service [to] send individual messages or fan-out messages to large numbers of recipients". It supports mobile push notifications to Apple, Google, Fire OS and Windows devices, as well as messages to HTTP endpoints, email recipients and other AWS services such as Amazon SQS and AWS Lambda.

Until recently, SNS only offered the ability to send SMS to recipients with a US based phone number, and with a comparatively restricted feature set, thereby limiting the service’s use cases and attractiveness for AWS’ global customer base. The revamped offering now supports more than 200 countries and also gained several new features, resulting in what Amazon claims to be "a single service to provide worldwide SMS delivery without having to identify and integrate with multiple messaging aggregators and managing phone numbers".

Amazon SNS Text Messaging Preferences

A table in the introductory blog post compares the previous SMS offering with the new worldwide SMS capabilities, with the most notable changes being:

  • Support of phone numbers in over 200 countries
  • Expansion to five more regions beyond us-east-1
  • Direct publishing to SMS-enabled devices
  • Removal of opt-in in favor of opt-out management
  • Delivery status monitoring
  • Explicit spending limits enforcement

It is now possible to send SMS message directly to SMS-enabled devices without first subscribing them to a SNS topic and awaiting the recipient's confirmation. The subscription based sending of SMS messages to multiple phone numbers has also been changed from opt-in to opt-out management of phone numbers:

Where required by local laws and regulations (such as the US and Canada), SMS recipients can use their devices to opt out by replying with STOP or ARRET (French) to the same long code or short code with which Amazon SNS delivered the message. After opting out, the recipient will no longer receive SMS messages delivered from your AWS account unless you opt in the phone number.

Users can view the phone numbers which have been opted out and can also opt them in again, but only once every thirty days.

Amazon SNS is one of the first AWS services that can enforce a spending limit via account-level preferences and "stops publishing SMS messages within minutes" when a SMS message delivery would incur a cost that exceeds the monthly limit (users can also monitor their entire AWS usage and cost with budgets and billing alerts on the account level).

Other preferences include the Amazon S3 bucket that receives the daily usage report as a CSV file, a default sender ID, and a default for the two new messaging modes, which can be overridden per message delivery:

  • Promotional – cost optimized for "noncritical messages, such as marketing messages"
  • Transactional – reliability optimized for "critical messages that support customer transactions, such as one-time passcodes for multi-factor authentication"

It is also possible to monitor SMS activity via CloudWatch Metrics and Logs for SMS deliveries. Users can create CloudWatch alarms to receive alerts when metrics such as the number of failed deliveries cross thresholds and can further analyze each delivery via the corresponding CloudWatch Logs record:

{
    "notification": {
        "messageId": "34d9b400-c6dd-5444-820d-fbeb0f1f54cf",
        "timestamp": "2016-06-28 00:40:34.558"
    },
    "delivery": {
        "phoneCarrier": "My Phone Carrier",
        "mnc": 270,
        "destination": "+1XXX5550100”,
        "priceInUSD": 0.00645,
        "smsType": "Transactional",
        "mcc": 310,
        "providerResponse": "Message has been accepted by phone carrier",
        "dwellTimeMs": 599,
        "dwellTimeMsUntilDeviceAck": 1344
    },
    "status": "SUCCESS"
}

The logged dwell times indicate the time between message publication to SNS and 1) message delivery to the destination carrier, and 2) acknowledgement of message delivery by the recipient carrier. If applicable, the provider response attribute communicates one of the SMS delivery failure reasons.

Neither Microsoft Azure's Notification Hubs nor Google Cloud Platform’s Cloud Pub/Sub services do support SMS messages at this point, though both are offering integrations with Twilio for higher level application services like Microsoft’s Logic Apps and Google’s App Engine.

The Amazon SNS documentation features a developer guide including a dedicated section on sending SMS messages, and the API reference. A separate FAQ is also available. SMS pricing varies per country, and in addition by carrier network as well as over time, which Amazon qualifies as a “transparent approach [to] get the maximum cost benefits”. Support is provided via the Amazon SNS forum.

Rate this Article

Adoption
Style

BT