Amazon Simple Notification Service (Amazon SNS) is a web service that makes it easy to set up, operate, and send notifications from the cloud. It provides developers with a highly scalable, flexible, and cost-effective capability to publish messages from an application and immediately deliver them to subscribers or other applications. It is designed to make web-scale computing easier for developers. Amazon SNS follows the “publish-subscribe” (pub-sub) messaging paradigm, with notifications being delivered to clients using a “push” mechanism that eliminates the need to periodically check or “poll” for new information and updates. With simple APIs requiring minimal up-front development effort, no maintenance or management overhead and pay-as-you-go pricing, Amazon SNS gives developers an easy mechanism to incorporate a powerful notification system with their applications.
Q: What are some example uses for Amazon SNS notifications?
The Amazon SNS service can support a wide variety of needs including monitoring applications, workflow systems, time-sensitive information updates, mobile applications, and any other application that generates or consumes notifications. For example, Amazon SNS can be used in workflow systems to relay events among distributed computer applications, move data between data stores or update records in business systems. Event updates and notifications concerning validation, approval, inventory changes and shipment status are immediately delivered to relevant system components as well as end-users. Another example use for Amazon SNS is to relay time-critical events to mobile applications and devices. Since Amazon SNS is both highly reliable and scalable, it provides significant advantages to developers who build applications that rely on real-time events.
Q: What are the benefits of using Amazon SNS?
Amazon SNS offers several benefits making it a versatile option for building and integrating loosely-coupled, distributed applications:
- Instantaneous, push-based delivery (no polling)
- Simple APIs and easy integration with applications
- Flexible message delivery over multiple transport protocols
- Inexpensive, pay-as-you-go model with no up-front costs
- Web-based AWS Management Console offers the simplicity of a point-and-click interface
Q: How does Amazon SNS work?
It is very easy to get started with Amazon SNS. Developers must first create a “topic” which is an “access point” – identifying a specific subject or event type – for publishing messages and allowing clients to subscribe for notifications. Once a topic is created, the topic owner can set policies for it such as limiting who can publish messages or subscribe to notifications, or specifying which notification protocols will be supported (i.e. HTTP/HTTPS, email, SMS). Subscribers are clients interested in receiving notifications from topics of interest; they can subscribe to a topic or be subscribed by the topic owner. Subscribers specify the protocol and end-point (URL, email address, etc.) for notifications to be delivered. When publishers have information or updates to notify their subscribers about, they can publish a message to the topic – which immediately triggers Amazon SNS to deliver the message to all applicable subscribers.
Q: How is Amazon SNS different from Amazon SQS?
Amazon Simple Queue Service (SQS) and Amazon SNS are both messaging services within AWS, which provide different benefits for developers. Amazon SNS allows applications to send time-critical messages to multiple subscribers through a “push” mechanism, eliminating the need to periodically check or “poll” for updates. Amazon SQS is a message queue service used by distributed applications to exchange messages through a polling model, and can be used to decouple sending and receiving components. Amazon SQS provides flexibility for distributed components of applications to send and receive messages without requiring each component to be concurrently available.
Q: How can I get started using Amazon SNS?
To sign up for Amazon SNS, click the “Sign up for Amazon SNS” button on the Amazon SNS detail page. You must have an Amazon Web Services account to access this service; if you do not already have one, you will be prompted to create one when you begin the Amazon SNS sign-up process. After signing up, please refer to the Amazon SNS documentation and Getting Started Guide to begin using Amazon SNS. Using the AWS Management Console, you can easily create topics, add subscribers, send notifications, and edit topic policies – all from your browser.
Q: Is Amazon SNS supported in the AWS Management Console? Amazon SNS is supported in the AWS Management Console which provides a point-and-click, web-based interface to access and manage Amazon SNS. Using the AWS Management Console, you can create topics, add subscribers, and send notifications – all from your browser. In addition, the AWS Management Console makes it easy to publish messages over your protocol of choice (HTTP, email, SQS protocol, etc.) and edit topic policies to control publisher and subscriber access. The AWS Management Console is provided free of charge at: http://aws.amazon.com/console
Q: What are the Amazon SNS service access points in each region?
The US East (Northern Virginia) end-point is: http://sns.us-east-1.amazonaws.com
The US West (Oregon) end-point is: http://sns.us-west-2.amazonaws.com
The US West (Northern California) end-point is: http://sns.us-west-1.amazonaws.com
The EU(Ireland) end-point is: http://sns.eu-west-1.amazonaws.com
The Asia Pacific (Singapore) end-point is: http://sns.ap-southeast-1.amazonaws.com
The Asia Pacific (Tokyo) end-point is: http://sns.ap-northeast-1.amazonaws.com
The Asia Pacific (Sydney) end-point is: http://sns.ap-southeast-2.amazonaws.com
The South America (Sao Paulo) end-point is: http://sns.sa-east-1.amazonaws.com
Q: Does AWS provide telephony service in conjunction with SNS?
Amazon SNS is a web service designed to enable applications to send notifications from the cloud. AWS does not provide telephony service or Internet access of any kind. Both the message publisher and notification subscriber are responsible for purchasing telephony services or Internet access from the third party carrier of their choice.
With Amazon SNS, there is no minimum fee and you pay only for what you use. Users pay $0.50 per 1 million Amazon SNS Requests, $0.06 per 100,000 Notification deliveries over HTTP, $0.75 per 100 Notification deliveries over SMS and $2.00 per 100,000 Notification deliveries over Email.
Amazon SNS also includes a Free Tier, where users can get started with Amazon SNS for free. Each month, Amazon SNS customers pay no charges for the first 1 million Amazon SNS Requests, no charges for the first 100,000 Notifications over HTTP, no charges for the first 100 Notifications over SMS and no charges for the first 1,000 Notifications over Email.
Please refer to the Amazon SNS Details page for additional details on pricing and data transfer costs.
Q: How will I be charged and billed for my use of Amazon SNS?
There are no set-up fees to begin using the service. At the end of the month, your credit card will automatically be charged for that month’s usage. You can view your charges for the current billing period at any time on the Amazon Web Services web site by logging into your Amazon Web Services account and clicking “Account Activity” under “Your Web Services Account”.
Q: When does billing of my Amazon SNS use begin and end?
Your Amazon SNS billing cycle begins on the first day of each month and ends on the last day of each month. Your monthly charges will be totaled at the end of each month.
Q: Do your prices include taxes?
Except as otherwise noted, our prices are exclusive of applicable taxes and duties, including VAT and applicable sales tax. For customers with a Japanese billing address, use of the Asia Pacific (Tokyo) Region is subject to Japanese Consumption Tax. Learn more.
Topic names are limited to 256 characters. Alphanumeric characters plus hyphens (-) and underscores (_) are allowed. Topic names must be unique within an AWS account. After you delete a topic, you can reuse the topic name. When a topic is created, Amazon SNS will assign a unique ARN (Amazon Resource Name) to the topic, which will include the service name (SNS), region, AWS ID of the user and the topic name. The ARN will be returned as part of the API call to create the topic. Whenever a publisher or subscriber needs to perform any action on the topic, they should reference the unique topic ARN.
The following is the ARN for a topic named “mytopic” created by a user with the AWS account ID “123456789012” and hosted in the US East region:
arn:aws:sns:us-east-1:1234567890123456:mytopic Note: Users should NOT attempt to build the topic ARN from its separate components – they should always use the name returned from the API call to create the topic.
Q: What are the available operations for Amazon SNS and who can perform these operations?
Amazon SNS provides a set of simple APIs to enable event notifications for topic owners, subscribers and publishers.
- CreateTopic – Create a new topic.
- DeleteTopic – Delete a previously created topic.
- ListTopics – List of topics owned by a particular user (AWS ID).
- ListSubscriptionsByTopic – List of subscriptions for a particular topic
- SetTopicAttributes – Set/modify topic attributes, including setting and modifying publisher/subscriber permissions, transports supported, etc.
- GetTopicAttributes – Get/view existing attributes of a topic
- AddPermission – Grant access to selected users for the specified actions
- RemovePermission – Remove permissions for selected users for the specified actions
- Subscribe – Register a new subscription on a particular topic, which will generate a confirmation message from Amazon SNS
- ConfirmSubscription – Respond to a subscription confirmation message, confirming the subscription request to receive notifications from the subscribed topic
- UnSubscribe – Cancel a previously registered subscription
- ListSubscriptions – List subscriptions owned by a particular user (AWS ID)
- Publish: Publish a new message to the topic.
Q: Why are there two different APIs to list subscriptions?
The two APIs to list subscriptions perform different functions and return different results:
- The ListSubscriptionsByTopic API allows a topic owner to see the list of all subscribers actively registered to a topic.
- The ListSubscriptions API allows a user to get a list of all their active subscriptions (to one or more topics).
Q: What are the different delivery formats/transports for receiving notifications?
In order for customers to have broad flexibility of delivery mechanisms, Amazon SNS supports notifications over multiple transport protocols. Customers can select one the following transports as part of the subscription requests:
- “HTTP”, “HTTPS” – Subscribers specify a URL as part of the subscription registration; notifications will be delivered through an HTTP POST to the specified URL.
- ”Email”, “Email-JSON” – Messages are sent to registered addresses as email. Email-JSON sends notifications as a JSON object, while Email sends text-based email.
- “SQS” – Users can specify an SQS queue as the endpoint; Amazon SNS will enqueue a notification message to the specified queue (which subscribers can then process using SQS APIs such as ReceiveMessage, DeleteMessage, etc.)
- “SMS” – Messages are sent to registered phone numbers as SMS text messages.
Q: Can topic owners control the transports that are allowed on topics they create/own?
Topic owners can configure specific transports on their topics by setting the appropriate permissions through access control policies.
Q: How does an owner set Access Control policies?
Please refer to the Amazon SNS Getting Started Guide for an overview of setting access control policies.
Q: Can a single topic support subscriptions over multiple protocols/transports?
Subscribers to an Amazon SNS topic can receive notifications on any transport supported by the topic. A topic can support subscriptions and notification deliveries over multiple transports.
Q: Can Amazon SNS be used with other AWS services?
Amazon SNS can be used with other AWS services such as Amazon SQS, Amazon EC2 and Amazon S3. Here is an example of how an order processing workflow system uses Amazon SNS with Amazon EC2, SQS, and SimpleDB. In this workflow system, messages are sent between application components whenever a transaction occurs or an order advances through the order processing pipeline. When a customer initially places an order, the transaction is first recorded in Amazon SimpleDB and an application running on Amazon EC2 forwards the order request to a payment processor which debits the customer’s credit card or bank account. Once approved, an order confirmation message is published to an Amazon SNS topic. In this case, the topic has various subscribers over Email/HTTP – merchant, customer and supply chain partners – and notifications sent by Amazon SNS for that topic can instantly update all of them that payment processing was successful. Notifications can also be used to orchestrate an order processing system running on EC2, where notifications sent over HTTP can trigger real-time processing in related components such as an inventory system or a shipping service. By integrating Amazon SNS with Amazon SQS, all notifications delivered are also persisted in an Amazon SQS queue where they are processed by an auditing application at a future time.
Q: Is Amazon SNS available in all regions where AWS services are available?
Amazon SNS is available in the US East (Northern Virginia), US West (Oregon), US West (Northern California), EU (Ireland), Asia Pacific (Singapore), Asia Pacific (Tokyo), Asia Pacific (Sydney) and South America (Sao Paulo) regions.
Q: How soon can customers recreate topics with previously used topic names?
Topic names should typically be available for reuse approximately 30-60 seconds after the previous topic with the same name has been deleted. The exact time will depend on the number of subscriptions which were active on the topic – topics with a few subscribers will be available instantly for reuse, topics with larger subscriber lists may take longer.
To receive email notifications for a particular topic, a subscriber should specify “Email” or “Email-JSON” as the protocol and provide a valid email address as the end-point. This can be done using the AWS Management Console or by calling the Amazon SNS API directly. Amazon SNS will then send an email with a confirmation link to the specified email address, and require the user monitoring the email address to explicitly opt-in for receiving email notifications from that particular topic. Once the user confirms the subscription by clicking the provided link, all messages published to the topic will be delivered to that email address. The AWS Management Console is available at: http://aws.amazon.com/console
Q: Why does Amazon SNS provide two different transports to receive notifications over email?
The two email transports are provided for two distinct types of customers/end-users. “Email-JSON” sends notifications as a JSON object, and is meant for applications to programmatically process emails. The ”Email” transport is meant for end-users/consumers and notifications are regular, text-based messages which are easily readable.
Q: Can a user change the Subject and Display name for notifications sent over Email/Email-JSON?
Amazon SNS allows users to specify the Subject field for emails as a parameter passed in to the Publish API call and can be different for every message published. The Display name for topics can be set using the SetTopicAttributes API – this name applies to all emails sent from this topic.
Q: Do subscribers need to specifically configure their email settings to receive notifications from Amazon SNS?
In most cases, users should be able to receive subscription confirmations and notifications from Amazon SNS without doing anything specific. However, there could be cases where the email provider’s default settings or other user-specific configurations mistakenly redirect the emails to the junk/spam folder. To ensure that users see confirmation messages and notifications sent from Amazon SNS, users can add “firstname.lastname@example.org” to their contact lists and check their junk/spam folders for messages from Amazon SNS.
Q: In the case of passing in an SQS queue as an end-point, will users need to create the queue prior to subscribing? What permissions will the queue require?
Using the SQS console, users should create the SQS queue prior to subscribing it to a Topic. Select this queue on the console, and from the ‘Queue Actions’ in the menu bar, select ‘Subscribe Queue to SNS Topic’ from the drop-down list. In the subscribe dialog box, select the topic from the ‘Choose a Topic’ drop-down list, and click the ‘Subscribe’ button. For complete step-by-step instructions, please refer to the Amazon SNS documentation.
Q: How would a developer setup an Amazon SQS queue to receive Amazon SNS notifications?
To have Amazon SNS deliver notifications to an SQS queue, a developer should subscribe to a topic specifying “SQS” as the transport and a valid SQS queue as the end-point. In order to allow the SQS queue to receive notifications from Amazon SNS, the SQS queue owner must subscribe the SQS queue to the Topic for Amazon SNS to successfully deliver messages to the queue.
If the user owns both the Amazon SNS topic being subscribed to and the SQS queue receiving the notifications, nothing further is required. Any message published to the topic will automatically be delivered to the specified SQS queue. If the user owning the SQS queue is not the owner of the topic, Amazon SNS will require an explicit confirmation to the subscription request.
Please refer to the Amazon SNS documentation for further details on subscribing an SQS queue to a topic and setting access control policies for SQS queues.
Q: How can I fanout identical messages to multiple SQS queues?
Create an SNS topic first using SNS. Then create and subscribe multiple SQS queues to the SNS topic. Now whenever a message is sent to the SNS topic, the message will be fanned out to the SQS queues, i.e. SNS will deliver the message to all the SQS queues that are subscribed to the topic.
Q: What is the format of structured notification messages sent by Amazon SNS?
The notification message sent by Amazon SNS for deliveries over HTTP, HTTPS, Email-JSON and SQS transport protocols will consist of a simple JSON object, which will include the following information:
- MessageId: A Universally Unique Identifier, unique for each notification published.
- Timestamp: The time (in GMT) at which the notification was published.
- TopicArn: The topic to which this message was published
- Type: The type of the delivery message, set to “Notification” for notification deliveries.
- UnsubscribeURL: A link to unsubscribe the end-point from this topic, and prevent receiving any further notifications.
- Message: The payload (body) of the message, as received from the publisher.
- Subject: The Subject field – if one was included as an optional parameter to the publish API call along with the message.
- Signature: Base64-encoded “SHA1withRSA” signature of the Message, MessageId, Subject (if present), Type, Timestamp, and Topic values.
- SignatureVersion: Version of the Amazon SNS signature used.
Notification messages sent over the “Email” transport only contain the payload (message body) as received from the publisher.
Q: How would a user subscribe for notifications to be delivered over SMS?
Please refer to the 'SMS Related Question' section below.
Q: Who can create a topic?
Topics can only be created by users with valid AWS IDs who have signed up for Amazon SNS. The easiest way to create a topic is to use the AWS Management Console. It can also be created through the CreateTopic API. The AWS Management Console is available at: http://aws.amazon.com/console
Q: Can multiple users publish to a single topic?
A topic owner can set explicit permissions to allow more than one user (with a valid AWS ID) to publish to a topic. By default, only topic owners have permissions to publish to a topic.
Q: How can the owner grant/revoke publish or subscribe permissions on a topic?
The AddPermission and RemovePermission APIs provide a simple interface for developers to add and remove permissions for a topic. However, for conditional access and more advanced use cases, users should use access control policies to manage permissions. The easiest way to manage permissions is to use the AWS Management Console. The AWS Management Console is available at: http://aws.amazon.com/console
Q: How does a topic owner give access to subscribers? Do subscribers have to have valid AWS IDs?
Amazon SNS makes it easy for users with and without AWS IDs to receive notifications. The owner of the topic can grant/restrict access to subscribers by setting appropriate permissions for the topic using Access Control policies. Users can receive notifications from Amazon SNS in two ways:
- Users with AWS IDs: Subscribers with valid AWS IDs (please refer to this link for details on obtaining AWS IDs) can subscribe to any topic directly – as long as the topic owner has granted them permissions to do so. The AWS IDs will be validated as part of the subscription registration.
- Other users: Topic owners can subscribe and register end-points on behalf of users without AWS IDs.
In both cases, the owner of the subscription endpoint needs to explicitly opt-in and confirm the subscription by replying to confirmation message sent by Amazon SNS.
Q: How will Amazon SNS authenticate API calls?
All API calls made to Amazon SNS will validate authenticity by requiring that requests be signed with the secret key of the AWS ID account and verifying the signature included in the requests.
Q: How does Amazon SNS validate a subscription request to ensure that notifications will not be sent to users as spam?
As part of the subscription registration, Amazon SNS will ensure that notifications are only sent to valid, registered subscribers/end-points. To prevent spam and ensure that a subscriber end-point is really interested in receiving notifications from a particular topic, Amazon SNS requires an explicit opt-in from subscribers using a 2-part handshake:
i. When a user first calls the Subscribe API and subscribes an end-point, Amazon SNS will send a confirmation message to the specified end-point.
ii. On receiving the confirmation message at the end-point, the subscriber should confirm the subscription request by sending a valid response. Only then will Amazon SNS consider the subscription request to be valid. If there is no response to the challenge, Amazon SNS will not send any notifications to that end-point. The exact mechanism of confirming the subscription varies by the transport protocol selected:
- For HTTP/HTTPS notifications, Amazon SNS will first POST the confirmation message (containing a token) to the specified URL. The application monitoring the URL will have to call the ConfirmSubscription API with the token included token.
- For Email and Email-JSON notifications, Amazon SNS will send an email to the specified address containing an embedded link. The user will need to click on the embedded link to confirm the subscription request.
- For SQS notifications, Amazon SNS will enqueue a challenge message containing a token to the specified queue. The application monitoring the queue will have to call the ConfirmSubscription API with the token.
- For SMS notifications, Amazon SNS will send an initial SMS subscription confirmation message to the specified phone number, and the user will need to respond with an SMS message confirming the subscription request. For additional details. please visit the 'SMS Related Questions' section below. enqueue a challenge message containing a token to the specified queue. The application monitoring the queue will have to call the ConfirmSubscription API with the token.
Note: The explicit “opt-in” steps described above are not required for the specific case where you subscribe your Amazon SQS queue to your Amazon SNS topic – and both are “owned” by the same AWS account.
Q: How long will subscription requests remain pending, while waiting to be confirmed?
Token included in the confirmation message sent to end-points on a subscription request are valid for 3 days.
Q: Who can change permissions on a topic?
Only the owner of the topic can change permissions for that topic.
Q: How can users verify that notification messages are sent from Amazon SNS?
To ensure the authenticity of the notifications, Amazon SNS will sign all notification deliveries using a cryptographically secure, asymmetric mechanism (private-public key pair based on certificates). Amazon SNS will publish its certificate to a well-known location (e.g. http://sns.us-east-1.amazonaws.com/SimpleNotificationService.pem for the US East region) and sign messages with the private key of that certificate. Developers/applications can obtain the certificate and validate the signature in the notifications with the certificate’s public key, to ensure that the notification was indeed sent out by Amazon SNS. For further details on certificate locations, please refer to the Amazon SNS details page.
Q: Do publishers have to sign messages as well?
Amazon SNS requires publishers with AWS IDs to validate their messages by signing messages with their secret AWS key; the signature is then validated by Amazon SNS.
Q: Can a publisher/subscriber use SSL to secure messages?
Yes, both publishers and subscribers can use SSL to help secure the channel to send and receive messages. Publishers can connect to Amazon SNS over HTTPS and publish messages over the SSL channel. Subscribers should register an SSL-enabled end-point as part of the subscription registration, and notifications will be delivered over a SSL channel to that end-point.
Q: What permissions does a subscriber need to allow Amazon SNS to send notifications to a registered endpoint?
The owner of the end-point receiving the notifications has to grant permissions for Amazon SNS to send messages to that end-point.
Q: How can subscriptions be unsubscribed?
Subscribers can be unsubscribed either by the topic owner, the subscription owner or others – depending on the mechanism used for confirming the subscription request.
- A subscription that was confirmed with the AuthenticateOnUnsubscribe flag set to True in the call to the ConfirmSubscription API call can only be unsubscribed by a topic owner or the subscription owner.
- If the subscription was confirmed anonymously without the AuthenticateOnUnsubscribe flag set to True, then it can be anonymously unsubscribed.
In all cases except when unsubscribed by the subscription owner, a final cancellation message will be sent to the end-point, allowing the endpoint owner to easily re-subscribe to the topic (if the Unsubscribe request was unintended or in error). For further details on the ConfirmSubscription API, please refer to the Amazon SNS documentation.
Amazon SNS stores all topic and message information within Amazon’s proven network infrastructure and datacenters. All messages are stored redundantly on multiple servers and in multiple data centers, which means that no single computer or network failure renders Amazon SNS inaccessible.
Q: Will a notification contain more than one message?
No, all notification messages will contain a single published message.
Q: How many times will a subscriber receive each message?
Although most of the time each message will be delivered to your application exactly once, the distributed nature of Amazon SNS and transient network conditions could result in occasional, duplicate messages at the subscriber end. Developers should design their applications such that processing a message more than once does not create any errors or inconsistencies.
Q: Will messages be delivered to me in the exact order they were published?
The Amazon SNS service will attempt to deliver messages from the publisher in the order they were published into the topic. However, network issues could potentially result in out-of-order messages at the subscriber end.
Q: Can a message be deleted after being published?
No, once a message has been successfully published to a topic, it cannot be recalled.
Q: Will Amazon SNS guarantee that messages will be delivered to the subscribed end-point?
When a message is published to a topic, Amazon SNS will attempt to deliver notifications to all subscribers registered for that topic. Due to potential Internet issues or Email delivery restrictions, sometimes the notification may not successfully reach an HTTP or Email end-point. In the case of HTTP, an SNS Delivery Policy can be used to control the retry pattern (linear, geometric, exponential backoff), maximum and minimum retry delays, and other parameters. If it is critical that all published messages be successfully processed, developers should have notifications delivered to an SQS queue (in addition to notifications over other transports).
The easiest way to subscribe a phone to receive SMS messages is to use the AWS Management Console. First, select the SNS topic you’d like to subscribe to (or create a new topic), click the ‘Create New Subscription’ button, select ‘SMS’ from the ‘Protocol’ drop down, and then enter your phone number as the ‘Endpoint’. Alternatively you can call the Amazon SNS API directly and specify ‘SMS’ as the delivery protocol, providing a valid phone number as the end- point. Amazon SNS will then send an SMS to the provided phone number, and require the user to explicitly opt-in for receiving SMS notifications from a particular topic. This confirmation has to be in the form of an SMS sent directly from the phone. Once the user confirms the subscription, all messages published to the topic will be delivered to that phone number as SMS messages. The AWS Management Console is available at: http://aws.amazon.com/console
Q: What is the format of a valid subscription phone number?
Currently Amazon SNS only accepts US phone numbers as valid subscriptions. These can be entered in the format ‘1-333-555-7777’ (i.e. 1 followed by the area code and the 7 digit phone number, with spaces, parentheses, hyphens, etc.).
Q: Do I need to do anything special to a topic to enable SMS deliveries?
Users should use existing mechanisms such as the AWS Management Console or the CreateTopic API call to create a new topic. In addition, for topics which will support SMS, developers must identify the topic by setting a Display name. This name will be included in all SMS messages sent from this topic.
Q: How will the DisplayName show up in an SMS message delivered?
SNS will include the topic DisplayName set by the topic owner in the initial part of the SMS message being delivered. So, for example, if the topic DisplayName is set to ‘Foo’, the message delivered will be as follows:
Foo > This is the payload of the published message.
Q: Do I have to set a DisplayName for a topic with SMS subscriptions?
Yes, for topics which will have SMS subscriptions, users need to set a valid topic DisplayName. Note: For topics without SMS subscriptions, the DisplayName field can be left empty.
Q: Are there any size restrictions on the length of the DisplayName?
In addition to being included as a topic identifier in SMS messages, the DisplayName is also used for the ‘From’ field in Email notification deliveries. So, while the maximum length of the DisplayName is 100 characters, due to the constrained format of SMS messaging, only the first 10 characters of the DisplayName will be included in SMS delivered. It is therefore recommended that for topics with SMS subscriptions, users set the DisplayName to have a maximum length of 10 characters or ensure that the first 10 characters of the DisplayName distinctly identify the topic.
Q: How do I stop SMS messages from being sent to my phone?
There are several ways to stop SMS notification deliveries from reaching a user’s phone. The easiest way is to reply ‘STOP’ or ‘QUIT’ to short code 30304 to unsubscribe from all topics and stop SMS deliveries. Users can also remove SMS subscriptions using the AWS Management console or by calling the Amazon SNS API directly.
Q: What short code will SMS notifications originate from?
Amazon SNS notifications will be sent from short code 30304 in the US.
Q: Are SMS subscriptions associated with Amazon SNS topics?
Yes – all SMS subscriptions are associated with Amazon SNS topics. There is no way to create an SMS subscription without associating it with a topic.
Q: Can SMS messages be sent from all AWS data center regions?
Initially, SMS messages can only be sent from topics created in the US East Region. However, an application can publish to the SNS service in US East from any other region. SMS notification support will be available in other AWS regions and countries in the coming months.
Q: Can I send an MMS message using Amazon SMS?
SNS does not support MMS messaging at this time.
Q: Can Amazon SNS be used to send SMS messages from other AWS services?
Yes – there are an increasing number of AWS services that use Amazon SNS to send service notifications including CloudWatch and S3 Reduced Redundancy. In addition to configuring and receiving email notifications for events of interest, you can also configure and receive SMS notifications for those same services. For example, you can easily setup a topic for CloudWatch Alarms which will receive alarm events. To this topic, you can subscribe an email address or a phone number (or both) as end-points for notifications to be delivered. Whenever CloudWatch detects a configured condition for an alarm to fire, it will publish a message to the SNS topic which will then delivered as an email or SMS to the appropriate end-point.
Q: How large can SMS notifications be?
SMS notifications are limited by protocol specification to no more than 140 characters per message for ASCII (or 70 characters for Unicode). Since all SMS messages sent out include the topic DisplayName, the sum of the topic DisplayName and the published message payload can at most be 140 characters (or 70 characters for Unicode). Any published message which exceeds this size will be truncated in the SMS sent out.
Q: Can Amazon SNS notifications be sent in both SMS and email format at the same time?
Yes – Amazon SNS can deliver notifications via different protocols at the same time. However, SMS messages are restricted in size to 140 total characters. For email, the maximum limit is 8K characters. Since messages must be kept short and abbreviations are often used with SMS, content that is formatted for email delivery may not display well when delivered via SMS.
Q: What is the format of the initial message sent to confirm the subscription request?
When a phone number for an SMS end-point is subscribed to a topic, Amazon SNS will send out an SMS message to the specified phone requesting that the subscription be confirmed. The format of this message is as follows:
Would you like to receive messages from Foo. Reply Yes Foo to receive messages. Reply Help or Stop. Msg&data rates may apply.
In this case ‘Foo’ is the DisplayName set for this topic. To confirm the subscription, users must respond with a confirmation SMS message: Yes Foo
That confirms this subscription. If such a message is not received by SNS, no further messages from Foo will be sent to this phone number.
Q: What is the format of an SMS notification sent in response to a published message?
Foo> This is the payload the published message.
where Foo is the DisplayName set for the topic.
Q: What is the format of a response to a ‘Help’ message?
In response to receiving a Help message, SNS will respond with the following message:
Visit http://aws.amazon.com/sns/sms or call 1-800-xxx-xxxx for help. Reply STOP to cancel. Msg&data rates may apply.
Q: Is there a ‘free tier’ allowance for SMS notifications?
There is a monthly free tier allowance for SMS messages. The first 100 SMS messages sent each month are free. Additional SMS messages cost $0.75 per 100 messages sent. For additional information on SMS pricing, please visit: http://aws.amazon.com/sns/pricing.
Q: What is the cost for receiving SMS message deliveries?
Pricing for SMS message delivery to mobile devices is based on your text message plan with your wireless carrier.
Q: Does Amazon SNS currently support notification delivery to international phone numbers?
Currently Amazon SNS will only accept US phone numbers as valid subscription end-points. SMS notification support will be available in other AWS regions and countries in the coming months.
SNS currently supports up to 3,000 topics per AWS Account. To request a higher limit, please contact us at http://aws.amazon.com/support
Q: How much and what kind of data can go in a message?
Amazon SNS messages can contain up to 64 KB (65,536 bytes) of text data, including XML, JSON and unformatted text. The following Unicode characters are accepted:
#x9 | #xA | #xD | [#x20 to #xD7FF] | [#xE000 to #xFFFD] | [#x10000 to #x10FFFF]
(according to http://www.w3.org/TR/REC-xml/#charsets).
Note: For SMS subscriptions, only 140 characters will be included in the payload of the message delivered. This will include the DisplayName of the topic and as many characters of the published message as can be accomodated.
Q: Are there TCP ports that should be used for cross-region communication between SNS and EC2?
Yes, cross-region communication between SNS and EC2 on ports other than 80/443/4080/8443 is not guaranteed to work and should be avoided.
You can now opt-in to get your messages delivered in raw form, i.e. exactly as you published them. By default, messages are delivered encoded in JSON that provides metadata about the message and topic. Raw message delivery can be enabled by setting the “RawMessageDelivery” property on the subscriptions. This property can be set by using the AWS Management Console, or by using the API SetSubscriptionAttributes.
Q: What is the default behavior if the raw message delivery property on the subscription is not set?
By default, if this property is not set, messages will be delivered in JSON format, which is the current behavior. This ensures existing applications will continue to operate as expected.
Q: Which types of endpoints support raw message delivery?
New raw message delivery support is added to endpoints of type SQS Queue and HTTP(S). Deliveries to Email and SMS endpoints will behave the same independent of the “RawMessageDelivery” property.
Q: How will raw messages be delivered to HTTP endpoints?
When raw-formatted messages are delivered to HTTP/s endpoints, the message body will be included in the body of the HTTP POST.
SNS Mobile Push lets you use Simple Notification Service (SNS) to deliver push notifications to Apple, Google, Fire OS, and Windows devices, as well as Android devices in China with Baidu Cloud Push. With push notifications, an installed mobile application can notify its users immediately by popping a notification about an event, without opening the application. For example, if you install a sports app and enable push notifications, the app can send you the latest score of your favorite team even if the app isn’t running. The notification appears on your device, and when you acknowledge it, the app launches to display more information. Users’ experiences are similar to receiving an SMS, but with enhanced functionality and at a fraction of the cost.
Q: How do I get started sending push notifications?
Push notifications can only be sent to devices that have your app installed, and whose users have opted in to receive them. SNS Mobile Push does not require explicit opt-in for sending push notifications, but iOS, Android and Kindle Fire operating systems do require it. In order to send push notifications with SNS, you must also register your app and each installed device with SNS. For more information, see Using Amazon SNS Mobile Push Notifications.
Q: Which push notifications platforms are supported?
Currently, the following push notifications platforms are supported:
- Amazon Device Messaging (ADM)
- Apple Push Notification Service (APNS)
- Google Cloud Messaging (GCM)
- Windows Push Notification Service (WNS) for Windows 8+ and Windows Phone 8.1+
- Microsoft Push Notification Service (MPNS) for Windows Phone 7+
- Baidu Cloud Push for Android devices in China
Q: How many push notifications can I send with the SNS Free Tier?
The SNS free tier includes 1 million publishes, plus 1 million mobile push deliveries. So you can send 1 million free push notifications every month. Notifications to all mobile push endpoints are all counted together toward your 1 million free mobile push deliveries.
Q: Does enabling push notifications require any special confirmations with SNS Mobile Push?
No, they do not. End-users opt-in to receive push notifications when they first run an app, whether or not SNS delivers the push notifications.
Q: Do I have to modify my client app to use SNS Mobile Push?
SNS does not require you to modify your client app. Baidu Cloud Push requires Baidu-specific components to be added to your client code in order to work properly, whether or not you choose to use SNS.
Q: How do SNS topics work with Mobile Push?
SNS topics can have subscribers from any supported push notifications platform, as well as any other endpoint type such as SMS or email. When you publish a notification to a topic, SNS will send identical copies of that message to each endpoint subscribed to the topic. If you use platform-specific payloads to define the exact payload sent to each push platform, the publish will fail if it exceeds the maximum payload size imposed by the relevant push notifications platform.
Q: What payload size is supported for various target platforms?
SNS will support maximum payload size that is supported by the underlying native platform. Customers can use a JSON object to send platform specific messages. See Using SNS Mobile Push API for additional details.
Q: How do platform-specific payloads work?
When you publish to a topic and want to have customized messages sent to endpoints for the different push notification platforms then you need to select “Use different message body for different protocols” option on the Publish dialog box and then update the messages. You can use platform-specific payloads to specify the exact API string that is relayed to each push notifications service. For example, you can use platform-specific payloads to manipulate the badge count of your iOS application via APNS. For more information, see Using Amazon SNS Mobile Push Notifications.
Q: Can one token subscribe to multiple topics?
Yes. Each token can be subscribed to an unlimited number of SNS topics.
Q: How many subscribers can be added to a single topic?
SNS currently supports up to 10,000 subscribers to any single topic. You can use SNS to notify an unlimited number of recipients. In order to reach more than 10,000 recipients, consider using direct addressing or multiple SNS topics.
Q: What is direct addressing? How does it work?
Direct addressing is a new delivery model for SNS that allows you to deliver notifications directly to a single endpoint, rather than sending identical messages to all subscribers of a topic. This is useful if you want to deliver precisely targeted messages to each recipient. When you register device tokens with SNS, SNS creates an endpoint that corresponds to the token. You can publish to the token endpoint just as you would publish to a topic. You can direct publish either the text of your notification, or a platform-specific payload that takes advantage of platform-specific features such as updating the badge count of your app. Direct addressing is currently only available for push notifications endpoints.
Q: Does SNS support direct addressing for SMS or Email?
No. At this time, direct addressing is only supported for mobile push endpoints (APNS, GCM, ADM, WNS, MPNS, Baidu).
Q: How does SNS Mobile Push handle token feedback from notification services?
SNS Mobile Push automatically handles token feedback services on your behalf, and exposes the feedback information via events published to a topic you may choose to consume. This approach reduces the operational burden of sending push notifications, and maximizes the speed and reliability with which your notifications are delivered. Push notifications services such as APNS and GCM provide feedback about tokens which may have expired or been replaced by new tokens. When a particular token is replaced by a new token, SNS automatically updates the associated endpoint, and notifies you via an event. When a particular token expires, perhaps because a user deleted your app, SNS marks the endpoint as disabled and notifies you via an event. You don’t strictly need to consume the feedback notifications in order to send push notifications with SNS, but may choose to do so based on your broader use case.
Q: Can I migrate existing apps to SNS Mobile Push?
Yes. You can perform a bulk upload of existing device tokens to Amazon SNS, either via the console interface or API. You would also register your app with SNS by uploading your credentials for the relevant push notifications services, and configure your proxy or app to register future new tokens with SNS.
Q: Can I monitor my push notifications through Amazon CloudWatch?
Yes. SNS publishes Cloudwatch metrics for number of messages published, number of successful notifications, number of failed notifications and size of data published. Metrics are available on per application basis. You can access Cloudwatch metrics via AWS Management Console or CloudWatch APIs.
Q: What types of Windows Push Notifications does Amazon SNS support?
SNS supports all types of push notifications types offered by Microsoft WNS and MPNS, including toast, tile, badge and raw notifications. Use the TYPE message attribute to specify which notification type you wish to use. When you use default payloads to send the same message to all mobile platforms, SNS will select toast notifications by default for Windows platforms. It is required to specify a notification type for Windows platforms when you use platform-specific payloads.
Q: Does SNS support Windows raw push notifications?
Yes. You must encode the notification payload as text to send raw notifications via SNS.
Q: Does SNS support authenticated MPNS?
SNS currently supports unauthenticated notifications to MPNS. For authenticated notifications to Windows Phone 8.1+ devices please also consider using Amazon SNS for Windows Notification Service (WNS).
Q: What is Baidu Cloud Push?
Baidu Cloud Push is a third-party alternative push notifications relay service for Android devices. You can use Baidu Cloud Push to reach Android customers in China, no matter what Android app store those customers choose to use for downloading your app. For more information about Baidu Cloud Push, visit: http://developer.baidu.com/cloud/push.
Q: Can I publish Baidu notifications from all public AWS regions?
Yes, SNS supports Baidu push notifications from all public AWS regions.
Q: Can I use Baidu notifications to any Android app store?
Yes, Baidu push notifications work for apps installed via any Android app store.
Q: What are message attributes?
Message attributes allow you to provide structured metadata items (such as timestamps, geospatial data, signatures, and identifiers) about the message. Message attributes are optional and separate from, but sent along with, the message body. This information can be used by the receiver of the message to help decide how to handle the message without having to first process the message body.
You can use SNS message attributes in conjunction with SQS and mobile push endpoints. To learn more about message attributes, please see the SNS Getting Started Guide.
Q: What message attributes are supported in SNS?
SNS supports different message attributes for each endpoint type, depending on what the endpoint types each support themselves.
- For SQS endpoints, you can specify up to 10 name-type-value triples per message. Types supported include: String, Binary and Number (including integers, floating point, and doubles).
- For mobile push endpoints, you can take advantage of specific message attributes that each mobile platform supports (such as notification type).