Application Integration | Amazon Simple Notification Service (SNS) Flashcards
What is Amazon Simple Notification Service (Amazon SNS)?
Overview
Amazon Simple Notification Service (SNS) | Application Integration
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.
How can I get started using Amazon SNS?
Overview
Amazon Simple Notification Service (SNS) | Application Integration
You can create an Amazon SNS topic and publish messages in a few steps by completing our 10-minute tutorial, Send Fanout Notifications.
For additional detail, see the Amazon SNS Developer Guide, and sample code in the Resource Center.
What are the benefits of using Amazon SNS?
Overview
Amazon Simple Notification Service (SNS) | Application Integration
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
What are some example uses for Amazon SNS notifications?
Overview
Amazon Simple Notification Service (SNS) | Application Integration
The Amazon SNS service can support a wide variety of needs including event notification, 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. A common pattern is to use SNS to publish messages to Amazon SQS message queues to reliably send messages to one or many system components asynchronously. 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.
How does Amazon SNS work?
Overview
Amazon Simple Notification Service (SNS) | Application Integration
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.
How is Amazon SNS different from Amazon SQS?
Overview
Amazon Simple Notification Service (SNS) | Application Integration
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.
A common pattern is to use SNS to publish messages to Amazon SQS queues to reliably send messages to one or many system components asynchronously.
How is Amazon SNS different from Amazon MQ?
Overview
Amazon Simple Notification Service (SNS) | Application Integration
Amazon MQ, Amazon SQS, and Amazon SNS are messaging services that are suitable for anyone from startups to enterprises. If you’re using messaging with existing applications, and want to move your messaging to the cloud quickly and easily, we recommend you consider Amazon MIt supports industry-standard APIs and protocols so you can switch from any standards-based message broker to Amazon MQ without rewriting the messaging code in your applications. If you are building brand new applications in the cloud, we recommend you consider Amazon SQS and Amazon SNS. Amazon SQS and SNS are lightweight, fully managed message queue and topic services that scale almost infinitely and provide simple, easy-to-use APIs. You can use Amazon SQS and SNS to decouple and scale microservices, distributed systems, and serverless applications, and improve reliability.
Overview
Amazon Simple Notification Service (SNS) | Application Integration
How can I get started using Amazon SNS?
Overview
Amazon Simple Notification Service (SNS) | Application Integration
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.
Is Amazon SNS supported in the AWS Management Console?
Overview
Amazon Simple Notification Service (SNS) | Application Integration
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 to your endpoint of choice (HTTP, SQS, Lambda, mobile push, email, or SMS) and edit topic policies to control publisher and subscriber access.
What are the Amazon SNS service access points in each region?
Overview
Amazon Simple Notification Service (SNS) | Application Integration
Please refer to the AWS Regions and Endpoints section of the AWS documentation for the latest list of all Amazon SNS service access points.
Can I get a history of SNS API calls made on my account for security analysis and operational troubleshooting purposes?
Billing
Amazon Simple Notification Service (SNS) | Application Integration
Yes. SNS supports AWS CloudTrail, a web service that records AWS API calls for your account and delivers log files to you. With CloudTrail, you can obtain a history of such information as the identity of the API caller, the time of the API call, the source IP address of the API caller, the request parameters, and the response elements returned by SNS.
SNS currently supports CloudTrail auditing for authenticated calls only. CloudTrail Audit logs for unauthenticated ConfirmSubscription and Unsubscribe calls are not available at this time. For more information, see the CloudTrail section of the SNS Developer Guide.
To receive a history of SNS API calls made on your account, simply turn on AWS CloudTrail in the AWS Management Console. To learn more about AWS CloudTrail, click here.
How much does Amazon SNS cost?
Billing
Amazon Simple Notification Service (SNS) | Application Integration
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, and $2.00 per 100,000 notification deliveries over email. For SMS messaging, users can send 100 free notification deliveries, and for subsequent messages charges vary by destination country.
Amazon SNS also includes a Free Tier, where users can get started with Amazon SNS for free. Each month, Amazon SNS customers incur 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.
How will I be charged and billed for my use of Amazon SNS?
Billing
Amazon Simple Notification Service (SNS) | Application Integration
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”.
When does billing of my Amazon SNS use begin and end?
Billing
Amazon Simple Notification Service (SNS) | Application Integration
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 totalled at the end of each month.
Do your prices include taxes?
Features and Functionality
Amazon Simple Notification Service (SNS) | Application Integration
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 AWS services is subject to Japanese Consumption Tax. Learn more.
What is the format of an Amazon SNS topic?
Features and Functionality
Amazon Simple Notification Service (SNS) | Application Integration
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.
What are the available operations for Amazon SNS and who can perform these operations?
Features and Functionality
Amazon Simple Notification Service (SNS) | Application Integration
Amazon SNS provides a set of simple APIs to enable event notifications for topic owners, subscribers and publishers.
Owner operations:
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
Subscriber operations:
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)
Publisher operations:
Publish: Publish a new message to the topic.
Why are there two different APIs to list subscriptions?
Features and Functionality
Amazon Simple Notification Service (SNS) | Application Integration
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).
What are the different delivery formats/transports for receiving notifications?
Features and Functionality
Amazon Simple Notification Service (SNS) | Application Integration
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 standard 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.). Note that FIFO queues are not currently supported.
“SMS” – Messages are sent to registered phone numbers as SMS text messages.
Can topic owners control the transports that are allowed on topics they create/own?
Features and Functionality
Amazon Simple Notification Service (SNS) | Application Integration
Topic owners can configure specific transports on their topics by setting the appropriate permissions through access control policies.
How does an owner set Access Control policies?
Features and Functionality
Amazon Simple Notification Service (SNS) | Application Integration
Please refer to the Amazon SNS Getting Started Guide for an overview of setting access control policies.
Can a single topic support subscriptions over multiple protocols/transports?
Features and Functionality
Amazon Simple Notification Service (SNS) | Application Integration
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.
Can subscribers selectively receive only a subset of messages published to a topic?
Features and Functionality
Amazon Simple Notification Service (SNS) | Application Integration
Yes, you can use message filtering on Amazon Simple Notification Service (SNS) to build simpler and more streamlined pub/sub architectures. Message filtering enables Amazon SNS topic subscribers to selectively receive only a subset of the messages they are interested in, as opposed to receiving all messages published to a topic. For more details, try our 10-minute tutorial, Filter Messages Published to Topics, or see the documentation.