What is Amazon Simple Notification Service?
Amazon Simple Notification Service (Amazon SNS) is a web service that coordinates and manages the delivery or sending of messages to subscribing endpoints or clients. In Amazon SNS, there are two types of clients—publishers and subscribers—also referred to as producers and consumers. Publishers communicate asynchronously with subscribers by producing and sending a message to a topic, which is a logical access point and communication channel. Subscribers (i.e., web servers, email addresses, Amazon SQS queues, AWS Lambda functions) consume or receive the message or notification over one of the supported protocols (i.e., Amazon SQS, HTTP/S, email, SMS, Lambda) when they are subscribed to the topic.
When using Amazon SNS, you (as the owner) create a topic and control access to it by defining policies that determine which publishers and subscribers can communicate with the topic. A publisher sends messages to topics that they have created or to topics they have permission to publish to. Instead of including a specific destination address in each message, a publisher sends a message to the topic. Amazon SNS matches the topic to a list of subscribers who have subscribed to that topic, and delivers the message to each of those subscribers. Each topic has a unique name that identifies the Amazon SNS endpoint for publishers to post messages and subscribers to register for notifications. Subscribers receive all messages published to the topics to which they subscribe, and all subscribers to a topic receive the same messages.
Are You a First-Time Amazon Simple Notification Service User?
If you are a first-time user of Amazon SNS, we recommend that you begin by reading the following sections:
What is Amazon SNS – The rest of this section includes a video that introduces Amazon SNS and walks you through the example presented in Getting Started with Amazon Simple Notification Service, and presents common use-case scenarios.
Getting Started – The Getting Started with Amazon Simple Notification Service section walks you through creating a topic, subscribing to it, publishing a message to it, unsubscribing from it, and finally, deleting the topic.
The following video introduces Amazon SNS and walks you through the example presented in Getting Started with Amazon Simple Notification Service.
Beyond the Getting Started Section
Beyond the getting started section, you'll probably want to learn more about Amazon SNS operations. The following sections provide detailed information about working with Amazon SNS:
You have detailed control over which endpoints a topic allows, who is able to publish to a topic, and under what conditions. This section shows you how to control access through the use of access control policies.
Amazon SNS and CloudWatch are integrated so you can collect, view, and analyze metrics for every active Amazon SNS topic.
You can use Amazon SNS to send messages to one or more Amazon SQS queues.
You can use Amazon Simple Notification Service (Amazon SNS) to send SMS notifications to SMS-enabled mobile phones and smart phones.
You can use Amazon SNS to send notification messages to one or more HTTP or HTTPS endpoints.
Accessing Amazon SNS
If you have an AWS account, you can access Amazon SNS in any of the following ways.
- AWS Management Console
The AWS Management Console provides a web interface where you can manage your compute, storage, and other cloud resources. Within the AWS Management Console, individual services have their own console. To open the Amazon SNS console, log in to https://console.aws.amazon.com/ and choose SNS from the console home page, or use the SNS console direct URL: https://console.aws.amazon.com/sns/. For a tutorial that helps you complete common SNS tasks in the console, see Getting Started with Amazon Simple Notification Service.
- AWS Command Line Interface (CLI)
Provides commands for a broad set of AWS products, and is supported on Windows, Mac, and Linux. To get started, see AWS Command Line Interface User Guide. For more information about the commands for Amazon SNS, see sns in the AWS Command Line Interface Reference.
- AWS Tools for Windows PowerShell
Provides commands for a broad set of AWS products for those who script in the PowerShell environment. To get started, see the AWS Tools for Windows PowerShell User Guide. For more information about the cmdlets for Amazon SNS, see Amazon Simple Notification Service in the AWS Tools for Windows PowerShell Reference.
- AWS SDKs
AWS provides SDKs (software development kits) that consist of libraries and sample code for various programming languages and platforms (Java, Python, Ruby, .NET, iOS, Android, etc.). The SDKs provide a convenient way to create programmatic access to Amazon SNS and AWS. For example, the SDKs take care of tasks such as cryptographically signing requests, managing errors, and retrying requests automatically. For information about the AWS SDKs, including how to download and install them, see the Tools for Amazon Web Services page.
- Amazon SNS Query API
You can access Amazon SNS and AWS programmatically by using the Amazon SNS Query API, which lets you issue requests directly to the service. For more information, see the Amazon Simple Notification Service API Reference.