Viewers: in countries Watching now:
Discover how Amazon Web Services (AWS) can be leveraged to deploy and scale your web applications. Author Jon Peck demonstrates how to build a simple application leveraging the Amazon cloud services while introducing the wide variety of products and services provided with AWS.
This course starts with an overview of the foundational services, such as Amazon EC2 for virtual servers, Amazon S3 for online data storage, and Amazon RDS for a scalable database solution. Plus, explore how application services such as the Amazon Simple Notification Service can reduce overhead. Jon combines these services in the final chapter, where he builds, deploys, and monitors an application.
The Amazon Simple Notification Service, or SNS for short, is a web service for sending notifications. SNS allows push notifications to be sent, meaning that whatever is getting the notifications doesn't need to check SNS for them. Notifications can be sent to a number of recipients, including http for servers, email and SMS text messages to phones. Amazon SNS is intended for small notifications and the features of this service reflects that. Starting with a maximum size of messages which is 64 kilobytes, the restriction is structured to be optimal for simple text and tiny structures.
Each subscriber must confirm the subscription to notifications which can be a bit cumbersome, especially as this includes servers which need a mechanism for confirming this description in addition to being able to receive a notification. The notifications can be sent in one or two formats: plain text, emails and SMS and JSON encoding which is optimal for server communication. SNS in good for internal status notifications in triggered events such as a payment problem being reported to an administrator or server triggers. It's not good for mass emailing users due to subscription confirmations, formats and other limitations.
The Simple Notification Service has its own set of terminology, but in comparison to other services, it's fairly small. A topic is the name of a group of subscribers. Topics are typically named for the subject in the notifications or some sort of underlying event type like server failures. As mentioned before, clients can subscribe to a topic. A topic owner, the account that created the topic, can directly subscribe clients. Regardless of how they subscribe, the client must always confirm the subscription.
Amazon SNS subscriptions are interesting as it really highlights how these messages are not intended for end-users. Subscribers to SNS notifications need to specify the protocol and endpoint. The protocol can be things like HTTP, email, SNS and others, while the endpoint is the recipient address; this includes an email, a URL or SMS number. When the description request is received, a confirmation is sent for explicit opt-ins by replying or clicking a link. If unconfirmed, no notifications will be sent and an unconfirmed subscriber will be removed in three days.
Notifications are not archived so they can't be reviewed later, so take that in a consideration when using the service. There is a number of different steps in the SNS workflow so I'll go over at a high level. First, the topic is created. A recipient subscribes and confirms their notification. Notifications are then published which trigger SNS to deliver the notifications. Now that I've provided some context into how Amazon SNS works, let's configure it for use with the watermarking application. Switching to the browser, go to the Management Console.
From the menu, go to Services > App Services > SNS. As this is the first time that I have used this system, there are no topics created. I can see the number of SNS topics that I managed along with a number of subscriptions in the upper right-hand corner. I am going to create a new topic for the watermarking application. So click on Create New Topic. Topic names are 256 alphanumeric characters, meaning A through Z, 0 through 9, additionally hyphen and underscore included.
I am going to use SNS to notify myself when there is a bad uploaded file. So I'll give it a logical name, watermark-bad-upload. For the Display Name, I'll give it a descriptive short name, WM for watermark, BAD for problem and UL for upload. Remember, these notifications aren't for end-users, so briefness is just fine. When ready, click Create Topic. Basic information about the topic is now shown.
Topic Amazon Resource Name, or ARN, is a unique identifier that is used programmatically. Topic owner, region and display name are self-explanatory. The list of subscribers which is currently empty is shown below. Clicking on all topic actions, a number of options are shown. Publish sends messages which I'll demonstrate shortly. Topic Policy gives control over who can publish and subscribe to the topic. The topic delivery policy controls the number of retries, seconds of delay and rate limiting.
It's good to have an audience for notifications even if it's an audience of one, so click Create New Subscription. This form has two options, the first, protocol, determines how messages will be delivered. I want to send myself a text message whenever there is a non image uploaded, so I'll select SMS as the protocol. The end-point indicates where the messages are going which be my producer cell phone number, click Subscribe. A text message will be sent from Amazon to confirm the subscription.
Follow the directions which are to reply with a text saying yes and the display name. So it will be yes WMBADUL. Once confirmed, close the message, click Refresh on the AWS page. An explicit subscription ID is shown along with a protocol endpoint and subscriber. To test the system, click Publish to Topic. The first input is the subject which should be left off for SMS messages.
If it's included, it will be shown as part of the message. The larger box for message is self-explanatory, but the option beneath allows different messages per protocol, such as a longer more detailed message via email and a simple summary as text. Leave the subject blank and for the message, I'll type "There was a bad upload from IP..." Click Publish Message, it will show a confirmation and just click Close. In a moment, a message will be sent.
SMS messages will append the display name followed by the message itself. Now that I have the topic, I can perform the final piece of configuration. I am going to switch to the terminal with a remote connection and reconnect if necessary. Then I'll update the configuration: sudo nano -w /var/www/html/config.inc.php, and for the SNS_TOPIC we'll do watermark- bad-upload, exit and save.
The notification will now be published if someone uploads non-image file to the watermarker. That's not practical in the long run, but it's good for testing. I have all the services necessary for the watermarker, so it's time to put it all together.
There are currently no FAQs about Up and Running with Amazon Web Services.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.