AWS Developer : All about Simple Notification Service (SNS) | Hashtag Learning | Skillshare

Playback Speed


  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x

AWS Developer : All about Simple Notification Service (SNS)

teacher avatar Hashtag Learning

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

20 Lessons (1h 58m)
    • 1. Introduction

      5:46
    • 2. What is SNS and use Cases ?

      3:09
    • 3. Understanding Topics & Subscribers

      3:28
    • 4. Creating First SNS Topic & Subscribe via Email

      6:24
    • 5. Publish to Topic using AWS CLI

      9:48
    • 6. Section Recap

      1:39
    • 7. Autoscaling - Use case description

      1:39
    • 8. SNS with Autoscaling events (Hands on Lab)

      7:08
    • 9. Cloudwatch - Use case description

      1:50
    • 10. SNS with Cloudwatch Alarms (Hands on Lab)

      12:19
    • 11. SQS - Use case description

      2:23
    • 12. SNS with SQS (Hands on Lab)

      11:04
    • 13. Trigger Lambda function with SNS (Hands on Lab)

      8:05
    • 14. Using SNS for sending SMS

      6:42
    • 15. SNS Applications overview

      3:24
    • 16. SNS Pricing

      3:42
    • 17. Part 1: Publish to SNS from Nodejs application

      10:05
    • 18. Part 2: Publish to SNS from Nodejs application

      11:39
    • 19. Conclusion

      1:19
    • 20. BONUS - Setup IAM with AWS CLI

      6:19
  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels
  • Beg/Int level
  • Int/Adv level

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.

73

Students

--

Projects

About This Class

Step by Step course to get an in depth understanding of SNS and discovering various use cases to leverage SNS

As you all know Amazon Web Services is one of the heavily used cloud platforms and it is really important to understand the key services and most heavily used services in AWS, one such service is Simple Notification Service. This service is pretty much tied to every AWS service like for example Autoscaling, cloudwatch, sqs and many more and it adds a great value to the AWS Services. Not only in AWS Ecosystem, SNS can be leveraged outside the AWS Ecosystem by using the aws creds. This allows may use cases like sending exception messages from application or sending critical information which helps you maintain your applications in a better way. With these broad use cases it is really important to understand SNS in and out to be able to better put to use. SNS Offers a lot of value to both the Developers as well as Administrators.

This course covers a lot of hands on labs to get you an in depth understanding of AWS SNS and you do not require any prior knowledge of using AWS.

By the end of the course students can take away a complete understanding of SNS as well as develops a lot of ideas to leverage SNS in their applications or administrative practices. 

I really hope that you will join the course and benefit from it.

Meet Your Teacher


 My name is Sai Kiran Rathan and I am currently working   as  an AWS System Administrator and Solutions Architect   for a software company in New Jersey. 

I hold AWS Certified Solutions Architect Associate & Professional,  AWS Certified Developer Associate, AWS Certified Sysops Administrator Certifications.
I am a huge cloud fan and i love to share everything i know about cloud.
My courses not only teach you about all the services that are offered in the cloud but also teach you how it is implemented in the real world scenarios.

See full profile

Class Ratings

Expectations Met?
  • Exceeded!
    0%
  • Yes
    0%
  • Somewhat
    0%
  • Not really
    0%
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.

Transcripts

1. Introduction: hello and welcome to hash tag landing courses. My name is Sai and I will be the instructor for this course. As you all know, AWS is one off the most heavily used cloud services. And it is really important for you toe understand the different important of services offered by them. And in this particular course, we're going to talk about simple notification service. Now, simple notification service is one off the heavily used AWS services as it ah place a key role in ah notifying the subscribers with critical information, whether it is related to your application or whether it this related to the services that are used by your company in the AWS ecosystem. And there are many different use cases now in this course, I have covered a lot of ground on simple notification services by discussing different use cases. Ah, and different services where you can ah, leverage SNS. And also I have shown you ah, a lot off step by step labs where you will get a clear understanding off how to use simple notification services. So ah, now let's go ahead and take a look at the curriculum itself. On what I'm going to cover in this particular course. Now, the first thing that I'm going to do is I'm going to start off by giving a introduction. So the simple notification service and I'm going to cover the SNS basics here. We're going to learn what SNS is And what are the different use cases that you can use. And apart from that, you're going to, ah, learn about the key components, like, what are the topics who are the subscribers and who can publish messages and so on and so forth. And the next thing that we're going to do is create our first lesson s topic and we're going to see the subscription options, will subscribe toe the SNS topic and test it out with an email. And then the next thing that we did waas using AWS Seelye for ah publishing a message to the simple notification service. Once that ah basic section is cleared on, we got a good understanding off what essences We're going to go ahead and use a sentence from different AWS services. Here we discussed the use case off using SNS with order scaling groups. Ah, and we of also covered a hands on lab where we go ahead and set up notifications with auto scaling. Next we covered another use case where a cenex plays a key role with just the cloudwatch alarms. And here also, we have ah discussed workload watches and we have created a cloudwatch alarm. And also we have hooked up the s and s and we have tested it out by putting up a new instance and ah so getting some data into cloudwatch and triggering our alarm and getting a notification through SNS. And the next thing that we have covered here is Theis Sqs. And here we have discussed the use case where you can use s and s toe publish messages to the sqs que and we have also seen how toe retrieve these messages from sqs using the AWS Eli. The next topic that we have covered here is triggering lambda functions from S and S. And we have seen how you can use lambda function. Ah, like how toe log the contents off the SMS message that you have sent into cloudwatch locks . And the next thing that we have covered is using SMS ah, with the S and s and we have done a hands on lab here as well. And we have seen ah, there different of options where you can leverage SMS using the AWS is in a service. And the next important thing that we have covered here is, um how much does it actually cost for you to use SNS pricing? And once we, ah, have covered that we went ahead and created a whole no Js application where you can publish a notification toe on the SNS topic and the essence topic will deliver that particular message to your email now. Ah, in this app of the main purpose off, this application wants to demonstrate the use case off using SNS from your applications which can send the exception messages or any critical information that would be useful for a developer toe debug hiss application, or to get to know the status our health office particular application. Now, also in the bonus section, I have added a lesson where you can learn how to set up a WC ally if you have no prior knowledge off AWS. Now, this particular course is, um, uh, helpful toe aws developers and administrators. And you don't need any prior knowledge off AWS to get started here. And, ah, if even if you don't know anything about, ah Amazon Web services, you can just get started and get to know what simple notification service is. And by the end off this course, you'll get a lot of ideas where you can implement SNS. And this will take your a limbless developer experience to the next level. And I really ah, um I hope that you guys come and join this course and ah, I'm really excited to see you all in the course and I will see you in the next lessons. Thank you so much for watching. 2. What is SNS and use Cases ?: Hello and welcome back. So this is our first lesson off the course. And let's get started with AWS SNS. Know what is a doubly assess anus? It is basically a simple notification service offered by Amazon, and it is like one off the heavily use services within the AWS equal system. Now you might be thinking like, what is SNS and like, Why is it heavily used? So basically, SNS is a notification service which acts like broker between the publisher and the receiver . So let's take an example and get it clear. So basically, let's say you have a or the scaling group being used in your AWS ec2. Now let's say you have some scaling activity going on like you're adding new instances or you're taking our Nunes taking out some old entrances from auto scaling. Then if you are actually interested in those kind of evens delivered to your email or getting a message to your mobile, or are any other use case? So in that cases, you can actually use AWS SNS, and you can basically ah, publish the evens from the AWS artist. Killing groups to SNS and SNS would be delivering those notifications toe the end subscriber, which can be your email or your lambda function, or your um http endpoint and many other subscription options start aws SNS offers. Now there are many other use cases basically like you can use it with cloud water alarms. You can use it with sqs. You can use it with the building alerts and so on and so forth. Basically, there are, like numerous use cases that you can use SNS with, and it is like one of the easiest way to use, and it is like one of the most commonly used service. Now a sentence is kind of important because it offers a lot of value to your application itself. Let's say you have an application being hosted in AWS are even outside the AWS ecosystem. And let's say you were interested in exception. Message is happening in your AWS are in your application itself, and you want you and you're interested in getting those, um, exception messages to your email or to your slack or to your lambda function, and you want to do some more research on Like what? What? That how your application is behaving and what exception to destroying and stuff like that . So you can use SNS like with with simple few steps. And then basically, you have a into n brokerage and network ah, notification service hooked up to your application or any other AWS service. Now Ah, I'll pose a lesson here. And let's get started with, like, the architecture off. Like how the SNS works and, like, what are the different, um, subscriber subscription option that it offers and how you convey Basically, use this a sentence in your applications. So that's it for this lesson, and I will see you in the next one. Thank you for watching. 3. Understanding Topics & Subscribers: hello and welcome back. So in this lesson, let's talk about some off the core components that are there in AWS SNS. And let's also see how they work together. Now, basically, there are three core components. The 1st 1 is the S and stopping. Now the topic is like the name suggests. It is like the point of interest which tells you like what this notification is about and who is pushing toe this notification. I mean, who is pushing to this topic and who can subscribe to this particular topic? Now, basically, this is help. This is used to organize between different notification use cases that you might have like scaling activities are exceptions. Now, basically, this SNS topics have ah, the properties like the display name the topic name and the Aaron. Now Aaron is Thea Abbas on resource name. Now that is being that that will be used to basically send ah notification to the topic and stuff like that. Now you can have complete control over your SNS topics like who can subscribe to this topic and who can publish to this topic and ah, and this is all control. Using the identity and access management. Now the second corps, competent in AWS essence is the publisher. Now, Publisher is like the one who pushes the notification are who sends the message to the topic. And these can be anything like the the scaling activity from the artist getting group Or it can be a cloud water Larmore or it can be your custom application with this kind of triggering this ah, message to the S and stop it Now the third important core component off the SNS subscriber , the subscriber is the one like it is also a client who basically receives the notification from the topic. Now the subscriber can be anyone like it can be a email message or it can be assessed SMS message or it can be Lambda function getting triggered and ah, it can be ah pushed to a SK askew and stuff like that. So these are the three core components off. 08 of your sexiness. Now let's see how they work together now. Basically, the they want you create a SNS topic. A publisher can basically send a message to that particular topic using its Aaron. No, Once the publisher publishes the message, he cannot call it back once it he sent it. It is done. Now it is the job off sns to figure out. Like who? All are subscribed to this particular topic. Now SNS will try to deliver those Ah, that particular message which it got from the publisher to all the endpoints that are being subscribed to that particular topic. Now the subscribers can be anyone from the Lambda, or it can be a simple que service or it could be any extra DPS custom endpoints. Oh, and it can be email or in SMS. Now that's how the AWS SNS works. And like I said, you can have complete control over like, who subscribes to this topic and who can publish to this particular topic using identity and access management Now. Ah, now that you know, like a little bit off about like Warda sentences like in the court confident in the next lessons, let's go ahead and create our first lesson s topic and let some let's do some, um, hands on lab on the SMS. So that's it for this lesson. And I will see in the next one. Thank you for watching 4. Creating First SNS Topic & Subscribe via Email: hello and welcome back. So now that you know a little bit about what it'll be excessiveness is and like the key confidence that are there In essence, let's go ahead and create our first topic. So to do that first you need to go to ah, log into your aws um console. And basically AWS SNS is a region specific service, so you need to choose your region first. Now I'm working in the island region, so have chosen the island region. If you want to choose, you can choose from any other different regions where your hosted him. So the next thing it's like basically, you need to go to the services and you need to search for simple notification service. Once you set that service, you're going to go to the dashboard. Now, under this dashboard, you can basically see that there are four different topics in my account already, and there are, like, two different subscriptions and like the zero applications and zero endpoint. Now I'm going to talk about the applications in the later lessons. But, uh, in this lesson, let's go ahead and create our first yes, and I stopping so to create a topic all you got to do it's like go to the topics in the left menu and, uh, select the button. Create new topic. Now the topic would take the topic name wherein, Like it tells you Like what the stopping is about. And the display name is the name that appears in your email or in your SMS where the end point who is subscribed to that. Now the display name is kind off like has the limitations off 10 characters when you're doing it via the console. But when I tried to go edit are the update the SNS display name off via aws Eli. It allowed me more than 10 characters and I'm going to show you how toe change the settings using the AWS Eli also. So let's go ahead and key in some topic name and we can say my first s and s topic and the display name. It's like first pissed and we'll go ahead and create the topic. So once your topic is created, just hit refresh and you should see it come right in the right in this part. And you can also search for your topics. So once you have your topic here, select the topic. Click on the air in. Then you should see more information about what this topic is doing and who subscribe to this. And, ah, where you can send this particular ah topic. Ah, well this particular topic and deliver the messages to now what we'll do is basically create a email subscription and let's just try Ah, tryout publishing a message to that particular topic and let's see if it gets still a word or not. So are you basically are to create a subscription all you got to do It's like select the bottom here, create subscription and you need to select the protocol now, Like I said, Ah, the SMS uh, the the SNS can take ah can publish to multiple different endpoints. The in points can be actually be issued GPS email. Email. Jace on Amazon Sqs application obligation is like to use it as a north push. Notifications are rest with your mobile application and ah, we'll cover that in the later section. But there is also AWS, Lambda and SMS, the one which were interested in for this lesson. ISTEA email And I'm going to choose my hashtag learning or test had rage email dot com. Let me just quickly confirm if that's the email that I want to use. Yes, so that's the email that I want to use and let me hit. Create subscription now. Once you ah, subscribe to this particular topic, the subscriber would get a notification whether or not to accept o r reject this particular subscription. So ah, once we send that, uh, let me pull my email toe the stab and you can see that the first test that's the basically the display in that we have chosen when we're creating the topic and regard a subscription confirmation message and confirm it all you are to do. It's like click on the confirm subscription. And now, whenever there is a ah, notification that is pushed to that particular topic, you'll start receiving the emails. Now let's go ahead and publish a publish our first message to this topic, and let's see if we get other email delivered to this particular email in point Now, to publish a topic there like multiple different ways. Like I said, like you can publish it from different database services or you can publish from your custom application, and also you can publish from the console from right here. So to do that from council, all you got to do it's like sex the bottom published topic, and you can say subject line as this is my first, um, message Bob Publishing. USNS and I can just copy this year you can send it as a BRA'TAC store. You can also send it as a Jason format. Um, if you want to send it as Jason, then you can say Jason message generator and you can select the targeted platform and you can like kind off gender the structure that that that specific format requires. So I'm not going to start now. I'm just going to choose the wrong message. And, ah, I just select all the like basic ah options here. And then I'll just select the published message now, once I published the message. Now let me pull my email back here and go back, and I should see another message coming here, which is my SNS topic pushing a notification to this particular email endpoint who is the subprime? But now you can see like this is my first message publishing to SNS from the first test topic. So that's how you create the business. And that's how you are. Add subscribers. And that's how you basically published a message to your topic and receive it. Yeah, they email now that's it for this lesson and I will see you in the next one. Thank you for watching. 5. Publish to Topic using AWS CLI: hello and welcome back. So in the previous lesson, we have created our first SNS topic, and we have seen how to subscribe and how toe basically push a message toe a particular topic using the AWS console. Now, in this lesson, what we're going to do is basically we're going to do the same things using the AWS, Eli. Now, this Eli is the command line interface. And if you want to know more about it, like and like get it set up for this particular example, you can check out my bonus section off this course. I have added some off the lessons. Like how? Toe download and install the AWS, Eli and how to create access keys and six and access keys and configure it to work with your command prompt. See, like enough now for this. Listen, I'm not going to show you that because I've already added to the bonus section. If you are interested in setting that up, you can check out that part and come back to this section toe, do a demo with me. So now let's get started with the Seelye part now, toe. So basically create a SNS topic using Seelye. All you got to do it's like open a command shell Prompt are like you can You can use a power shell prompt. Oh, and just type aws SNS and help. Now, you can basically see what are the different, um, options that this particular AWS SNS command has. And let's check it out. So you can basically add permissions. Check if four numbers operate out or not confirmed subscription, and they're a bunch of different things. The important thing that we're interested in here is basically the create topic. Now, let's go ahead and see what this create topic takes the input pass. Soto, check that. All you got to do us basically said at this spot, copy it clear from here, and then type aws sns and paste that and type help again. Now you can see it kind of gives us a detailed information about, like what it takes and like, what it expects and what the output would be so basically. Ah, like I said, you have this, um, command, which is taking, like, terribly, assassin s creed, a topic, and then it is doing that stash name and then you have to give it in the name and basically , that's pretty much it. Okay, so let's go ahead and create our topic using the sea like so. Ah, so the command that we're going to use us basically, let me come out off this, clear it out and topic and that stash name, and we're going to give the name ass in strength. You're going to say, Ah, my Seelye, first SNS topic and then just hit. Enter Now you should see that your topic is created. And the Aaron, he's ah, basically ah, having the name off your topic. Now, if you go back to your ah, it'll be a Seelye and go to the topics and refresh. You should basically see Ah, you are. Oh, so, like I said, this is a region specific. My default credentials were configured toe Ah, point to us East one Ah, which I didn't change here or specified years. So it kind of created in that region. So now let's create the same topic again and supply the region perimeter, which is disastrous region. And let's say you dash west dash one and he gender. Now you can basically see that here. It's saying that it's from US East one. And now it created the same topic in the U West one. Now let's go back here and then hit, Refresh. And now we should see our my first See Elias next topic. Now you can see that there is no display name. Ah, present here. Now you can like a said in the previous lesson. Or when you're doing it with the console. There's a limit off 10 characters. And when you're doing it, see Ally, I cannot observe that it takes more than 10 characters. Now I'm going to show that to you are how do basically our ended thes sns topics using natively Seelye. Now let me go back to the AWS, Eli here and clear it. Clear the screen. Let's do it! Oh yes, SNS help again. Now here the one which I am interested in is the set topic attribute and let's see what options it gives us for that particular option here. So set topic Nash attributes and let's hit help. And now here you can see that it is basically taking the topic. Aaron. It is taking the attributes name and it's taking the attributes value now if you hit more. It should basically see. Show us the example off. Oh, how to use it. Now you can see that the topic Erin, is there. You have valid values for the attribute name is the policy display name and delivery policy . The one which were interest rate in this, that the display name, and we'll set a value to it. So to do that, all I'm gonna do is type terribly s SNS. And, uh, I'm gonna do basically set topic attributes and I'm going to give Dash Dash topic Dash. Yaron, I'm going to select that from here. Copy it, based it here, and it should be in court. And the next attribute that we want supply is the basically attributes that name, which is going to be display name. And the next at the next input that we want to do is the attribute cash value. And we are going to say this is asked like, uh, first Seelye about picked, uh, you can clearly see that this is kind of more than 10 characters that I'm supplying toe this display name and I'm just going to hit Enter now. You should basically ah topic air and Ah, Did I enter something wrong here? Yes. So I did the same mistake again. So I didn't supply the region. And it doesn't know that particular topic. Aaron in us East one. So I'm just gonna supply the region. You dash west, Dash one and hit. Enter. Now it should successfully change because it does Didn't show us any error here. So basically, that's changed. Now, if I refresh this particular page here, you should see a display name coming. Ah, being set to this particular topic. So that's how you basically used the AWS eli toe Kind of create the topics and edit the topics. Now, let's go ahead and see how toe basically, um published a, um message using the AWS Eli itself. Now to do that, I'm going back to my aws. Ah, my partial prompt. I'm going to clear it out from here when the search for aws SNS help and I the one which I'm interested in basically he's ah publish. So I'm going to do it. Oh yes. SNS publish help and see what options we get from here. So it is taking basically the air and ah, the target they are in the phone number message. Okay. Eso Let's see the examples here and construct our own message. Yeah, So let's say we have Ah, we have this particular topic that we have already created in the previous lesson. And we have subscriber to this. So I'm gonna choose this particular Aaron and copy it and go to my eight of yes s s publish , and I'm going to supply That's topic Dash here in and we're going toe put there in the double courts. And we have We're giving the message, Aziz. Hello. This is my first ah message from CLI and I'm just gonna hit Enter now. This should be basically delivered to my email. Ah, I'm doing the same mistake again and again. I didn't supply the region U s ah, you West bash one hit tender and concede that you got back the message I d. That means that the, uh, publish has been successfully posted toe the two year SNS topic. And now if I open up my email off, it should be okay. So here's my email. And if I go back to my email here and hit Refresh Now you can see that. Ah, hello This is my first message from sea like so now this is how you basically publish your ah messages to the SNS topics using the AWS. So Ah, that's it for this lesson. And I'm going to see you in the next one. Thank you for watching. 6. Section Recap: Hello and welcome back. So this is our quick recap on what we have done in this first section. So we basically started off by giving a interaction toe what SNS is and like, how how it is used and like one of the different use cases. And then we have covered, Like what? The key components are like the publisher, the topics and the subscribers and, like the ah, like how they will all work together. And then we did a lab on SNS using the AWS console in this part. We actually created our first test in a stop IQ and we have created our subscription and we published a message using the AWS console on and in the next lesson. What we did was like we did a lab on the SNS using the AWS Eli where and we have learned, like, how do you see a lie to basically create a topic? And then we have seen how toe edit the attributes off the topic. And also we have seen how to publish a message to a topic using the AWS Eli. So I think we have covered a lot of ground in this section. I mean like you might have Oh, garden, like a very good understanding on Like what the SNS is and like how to use and like, the basics that are required for every AWS developer to use s and s and ah, in the next sections, I'm goingto go in depth like the different use cases and, like how toe implement them are using the AWS s a nest. So that's it for this section. And I will see you in the next one. Thank you so much for watching. 7. Autoscaling - Use case description: Hello and welcome back. So now that you know Ah, a little bit about what s and assets. Let's go ahead and see some off the use cases where you can apply the simple notification service. So let's get started with using SNS wit or the skating groups now. Ah, if you're If you're not family, read order scaling groups are a little bit off Baghlan about it is basically it ah enables you to scale dynamically based off off cloudwatch alarms like laden, tea alarms or CPU alarms. Those kind of things where you don't need to worry about, um, pre provisioning instances or the scaling group would take care off the adding new instances when there is Lord for your application and so on and so forth. Now, in these scenarios, I mean, when you're adding instances and taking out the instances from the order scaling Group A and under the load balancer, that kind of information might also be helpful for a administrator who is taking care off this infrastructure of it scaling notifications coming to him. So for those uh, purpose, we would need someone to notify us, right? So the in this place we could use note a sentence to get notified of an hour. There is some scaling activity going on with your auto scaling group, so Ah, that's a little bit of background. And ah, in the next lesson, we're going toe or do the lab for this particular parked, so thank you for watching and stay tuned. 8. SNS with Autoscaling events (Hands on Lab): Hello and welcome back. So, like we discussed in the previous introduction for the use case with Auto Scaling Group. Now we're going to go ahead and configure our SMS notification with daughters killing groups. Ah, little bit off. Um uh, heads up here. His basically. You need a order. Skilling Group created already. Um, because I'm not going to cover that part. Ah, and I'm just going to use some water scaling group that is available in my account right now. Um, so let's go ahead and create our SNS topic first that we're going to use with this particular orders getting group. So to do that first log into your AWS console and once you're logged in. But I've been sns here and go to the simple notification service. Now, once you're here, go to the topics. I guess you might already be family. Or with this What? I'm just going through the steps. Select written, clear, new topic. And you can say SG um, notifications in their score. SNS lesson Just to be clear, not we get infused, uh, with the old ones. And here we just do is G notifications. See 95 select. Create topic. Okay, so now our topic is created. Now let's go back to our easy to section and let's go ahead and add this notification to the order scaling group. To do that, go to services and type E C two and once you're in here straight until this opens up. Okay, so now that we're here on the left menu are if you scroll down your sea or the scaling section here and here, you can select the orders killing groups. And I think I should already have to off them. Yes, So I have to off them already. Ah, present here. If you don't have an artist killing group, you can always go ahead and create an order. Skilling Group. It is really simple. All you need to do is create a NA launch configuration which specifies what type off instance you want to put up. And once you have that, you could go ahead and clear. D um, auto scaling group. It has simple options, and the menu should walk you through the different steps off how to create the auto scaling group. So in this lesson, we're not going to cover that. So I'm going toe cancel and come back. Now I'm going to select this particular artist killing group, which is my big company obligation. Yes, D This is from one of my other courses. So I just have this left over or the scaling group And here you can see that I have different configurations saying that I have desired zero minimum zero and maximum zero and you can see different options here. And the one that we're interested in is the notification stop here. So go to the notification section and you can see that there is nothing configured here. So what we're going to do is we're going to say create notification and here we're going to say, Ah, select. Oh, it already populated the SNS that we have created here. So you can select the ASD notifications Underscore assistant. Ah, tennis lesson. And if you're if you want, you can also give a new name and you can create a topic here. No. And you can also select what type off notification that you're interested in. It may be a launch message or it on rand message are failed. Launch fatal terminate or you can also have your SNS. Topics are different estimates. Topics for launch, end of failed to launch and terminate and failed retirement so that you can differentiate and organized between different types off notifications in your system. Ah, that's up to you know, But for this example, I'm just going to select all of the activities that I want to get notified on and then I just have to select safe. Now, this is actually hooked up, and all we gotta do is basically go to the essence again and at a subscriber to it and boot up a new instance here, and we should be seeing a SMS notification coming through to our email address that we have subscribe to. So let's go ahead and do that. So what we need to do is go toe the simple notification service. Once you are here, select the topic that we have ah, hooked up to that order Skilling Group, which is this a sentence lesson And here we're going to create a subscription and we want to choose Thea email as our subscription option, and I have this email address that I want toe get notified on. So I just need to select create subscription now, I need to go back to my email address to confirm that subscription. So let me put up that email. Oh, okay, so I already got a subscription message to this particular email address. All I need to do is ah, select confirm subscription. That word. Confirm the subscription. And once I'm done with that, I need to go back to my AWS console to go to the order scaling group age. Now, all I need to do is at though instance, No, I'm saying, like, I want one instance to be added a minimum one and maximum one. And once I hit, save a new instance should start coming up in the instance of step. So let's give it a quick 30 seconds, and you can see that the instances putting up So now, once this goes from pending to in service in the life cycle state Ah, we should receive a notification shortly. I'm gonna pause this for a second, and then I'm going to come back once. Oh, it is up and running. Okay, So the instance just turned into service. So let's go back toe my email address and let's give it a quick refresh and you can already see that. Ah, I Garda scaling notification. Notified to my email which say's, um what's the service? That was, um, modified in which are the scaling group launched? A new instance? And who launched it? What was the change? It was Was it from Gerald 1120 The instance Get added or removed? Or what's the status currently? And what's the instance I d that it launched and buried it launched. So this kind of information is really useful when ah, you are administrating a specific environment and you're accountable for the healthy infrastructure then always notifications from every part off the service in AWS is helpful . So I hope you really like this, um Lap part and I will see you in the next one. Thank you for watching. 9. Cloudwatch - Use case description: hello and welcome back. So in this lesson, let's take another use case where weaken apply the SNS to which is nothing but the cloudwatch. Now, if you don't know what Cloudwatch is Ah, here's a little bit off background. So basically ah cloudwatch is a eight of your service off which collects the data from different parts of the service on the data can be, ah, a metric data or log data are or any off the data that makes sense for your application. You can send it to ah cloudwatch and ah, God Watch will save that data and then it will allow you to configure alarms are it will configure you you can basically wanted or your state of self your application and you can do many things there. So the the the use case where s and as comes into picture is whenever you create any alarm , you would like to get notified. So it's asking plastic so you have an alarm and it gets triggered. Or when it's ghost goes to an alarm state or an OK state, or if there is no data coming into that particular alarm, you want to get notified so How do you get notified using the essence. So it's asking plastic. So Ah, so this is the use case that we on the cover and in this particular lap in the next lesson , we're going to do the lab. So in that lab, what we're going to do is we're going to create a cloudwatch alarm. I'm going to just walk you through like how the cloudwatch page looks like and what you can do in cloudwatch. And we can create a example cloudwatch alarm. And then we can see how we can configure our notifications. And what are the different things that you can do there and I will see you in the lab. Listen, thank you for watching. 10. SNS with Cloudwatch Alarms (Hands on Lab): Hello and welcome back. So in the previous lesson, we have covered the interaction off what we're going to do in this particular lap, that is, we're going to go ahead and create a card watch alarm, and we're going to hook it up with the simple notification service now, Ah, to do that first, what we're going to do is just like we did another lessons. You're going to go ahead and create a SNS topic, and we're going to do that right away. So to do that first you need to log into your AWS console. Once you're here, go to simple notification service and ah, let me read until this puts up. Okay, so now you're here, go to the topics, create a new topic, and we can just do cloudwatch. I'm going toe configure a high Cebu alarm s so I'm just going to give it a high CPU are are just like CPU alarms. Okay, so, uh, the display name again, I'm going to see cloudwatch. And I'm just going toe select. Create topic. Okay, so now we have a s s stopping ready. Now. We need to go ahead and configure our Claro Tulum So the alarm that I want to configure is a CPU based alarm, and I want to do it across my auto scaling group. Now, in the previous lesson, have sure knew what an auto scaling group is and like whenever a new instance comes up, we have hooked up a, um, SMS notification, which triggers an email. Ah, in this lesson, what we're going to do it's like whenever, ah, the CPO utilization For the instances across all the all the census within that particular artist killing group, we're going toe configure some alarms over that particular data. So to do that, I'm going toe go ahead to the studio section and I'm going to show you where that particular thing is configured. So first thing is, um, you need to have a order skating group. I have some order skating groups left from my previous examples. So this is not an artist killing group course, So I'm not going to go ahead and show you like dictation off the scaling group. It's ready, straightforward. Once you have an order Skilling Group, you can always go ahead and implement things, so I'm going to create the, um, notification for the instances across this particular auto scaling group. So first thing that we need to do is go to the cloudwatch. So to do that, select the services and type in cloudwatch open it in a new tab. Okay, so once you're here ah, you can see that I have some alarms that have created for my previous lessons. But, um uh, the other courses. So we're not going to use any off piece. We're just going to go ahead going toe alarms and we're going toe select. Create alarm. Now, here in the cloudwatch, you have different sections. You have metrics coming in. Metrics are like the data which gets collected either. Ah, custom data Custom metric data are the default metrics data, which AWS provides whenever you boot up. In new instance, the data could be like the CPU data or the discreet right data or the Laden see across the load balancer or the number off request coming to the load balancer. And there are, like many different data, that's president include watch by default when you're using AWS resources and you also get to view the data in across different dimensions. We just like, um, how Maney, How much of you is used across like differently? See two instances or a specific issue. Two instance under artist killing group and so on and so forth. So we're not going to cover all those things, But I'm I'm definitely going to show you in this example. Like Howard, I mention is used because we're going toe configure an alarm which is basically going toe be across the CPU for across the instances in the particular artist killing group. So to do that, first off we need to do is go to the alarms and goto the create alarm. Now, here is where you're going to select which metric you want toe. Ah, configure your alarm. So the automatic that I am interested in is basically the ec2 metrics. Now, if I select the ec2 metrics, you can see that Ah, there are many things, but we want to do by Auto Scaling Group because we want the dimension off the order Skilling group. So I'm going to say I want the, um this particular auto scaling group. It is my big company application SG so I can see that my big company application a city is here and these are the different metrics that are available to me. So the one which I am interested in is the CPU utilization. I'm going to select the CPI utilization, and you can see that there is no information here because we don't have any instances running ass off now. But once we boot up an instance, we'll see some data coming in. And then we can ah see how our alarms work off so as off No, there is nothing here. So I'm just going to, ah, select what type off data that I'm interested in. So I'm just going to say I'm average CPU across every minute is my dimension. That's like I want to collect Ah, the unit across Ah, all instances theatrics. And for every one minute, So I'm just going to sell it. That and the next thing I'm going to do is select next. So here I'm going to give a name to it. I'm going to say, Ah, cloudwatch. Um let's a CPU utilisation alarm and let's let's give it high CPU, okay? And we're going to say if CPU utilization is greater than or equal to 70 person, so that's that's like a normal thing like you have 100% Cebu. If for over 70% of this country high CPU because you don't have enough headroom after that toe, manage the applications lower. Are your importers or any any off the services that are running in that instant? So ah, 70% is considered high CPU. And once you have that, you're going to say if it is greater than 70% for ah one, uh, you can say five or five data points are like for five are off five data points. That is, we have data born getting collector for every minute. So it it's like for every five minutes. If if if the sib utilization is over 70% for five minutes consecutively, then you're going to trigger an alarm. So here are what we're going to say is, Ah, the next thing is for you going to say different actions that we want to take. So when we when the alarm is in ST, we want to notify it toe the ah CPU cloudwatch CPU alarms, and we also want to notify when the status insufficient. Um, this is just for the example so that we want to see if anything is get all getting triggered or not. And we want to select this. And also we want to see the status. Okay, then we want to go to the same alarm, which is our, um What's up? You okay? Now, before hitting you create alarm. I'm just going to go ahead and add the, um what you call at the subscriber to it so that we don't lose out on the on the notification that gets triggered when the data is insufficient. So I'm going to go ahead into cloudwatch CP Alarms and I'm going to Ah, get email that I want to subscription. I'm going to select the email type in it. I wouldn't hash tag turning test Jamil calm and we quickly Very five. That's right. One Okay. And I'm goingto select. Create subscription. Ah, but me see spending subscription receive garden emails. Okay, so I did get an email saying that Ah, there's a come from a subscription request. I'm just going to silicon from subscription. Okay, it's done. Now. If I refresh here, it should be in a confirmed state. Okay? Yes. So this is basically ah ready to go. And the next thing that I want to do is go back to the cloudwatch alarm and I'm just going to say create alarm now, Um, what usually happens is when you first create an alarm, there's no data. So there is basically it's in. It's in an insufficient state. So we should probably see a trigger, although, or what I want to do is go ahead and add a new Oh, easy to instance, Soto, this particular order Skilling group To do that, I'm just going to add a new Eastern's here and select save. Oh, if I give it a minute or two shirt Had a new instance here. Okay, So the new instances coming up and ah, what I'm going to do, it's like I'm going to pause this lesson here, and then I'm going to wait for five minutes because after five minutes I can see that the alarm will go off for, uh, the data being insufficient and for the data being insufficient toe okay, state because we have, ah, the new instance coming up. So once a new instance comes up, it starts giving us the CPU metric and the CPU metric will then go ahead and triggered that alarm, which is the ok state. So I'm going to pass us here and then I'm going to come back. Want to this? Ready? Okay, So after a five minutes or so, what happened? It's like I've got an email from Cloudwatch saying that it went into in okay state because ah, what happened is a new instance came up and it reported that it was having 56% soup utilization. And it was not greater than the special value that we have set with a 70%. And that's why it went into an okay transition state. And once it went into okay, Transition state, we have configured in alarm of it stays, which gets triggered if it's in Tokyo State. So that's why I garden is ah, garden email notification, saying that my, uh, alarm went from insufficient data to win OK state. So this is how you can utilize SNS are using the cloudwatch alarms and it is really helpful as an administrator to get this kind of inside for your applications. And ah, this kind off notifications would help you figure out if something is something wrong is going on our like you can proactively, um, investigate problems even before you take down your system and you can have your service up and running. So I really hope that you like this lab and ah, that's it for this lesson. And thank you for watching. 11. SQS - Use case description: hello and welcome back. So I really hope that you are liking our examples and use cases that you can use with SNS. And in this lesson, we're going to cover another use case that is using SNS with sqs. Now, you might be wondering what sqs is. It is basically a simple que service. It is a que service which allows you to ah, pull the our information which is there in the queue on demand, and you can process, um ah, anything, um interesting data that you have in that queue. And then based on that particular data, you can process some ah functionality within your application now. Ah, the use cases where you can use the SNS along with sqs is let's say you have some, like some application which is doing some critical task, and you want to notify someone. Astin, as that particular exception happens, are some particular pretty good step happens within your application and you also want to process Ah, you want to be able to process that particular message in a later point for some other analytic purpose or any other purpose that you your use case might have. So in this case. How the SNS works is your application. Will, ah, send a message to the S and s, and you will have multiple subscribers. One subscriber. You will just send a email, notification or any other notification where you process that data immediately and it get sent. Ah, it get it gets received by the user as soon as it is ready. But it also sends to another subscriber, which would be your rescue askew and sqs. Q can hold your message for a for a little longer, and you can manually pull that particular message whenever you're ready to process and you want to do some analytics on it. So in the next lesson, we're going to go ahead and do this particular lab and I'm going to show you step by step, process off, creating SNS, creating sqs and how to publish a message from a sinister sqs. And also, I'm going to show you Ah, through a cli how to receive that particular message that you got in your cue. So I'm really excited to show you this lesson. So I'll see you in the next one. Thank you for watching 12. SNS with SQS (Hands on Lab): hello and welcome back. So in the previous lesson, I have given an interruption toe what we're going to do in this particular lab. So let's go ahead and get started. So the first thing that I want to do is go toe the simple notification service, and I want to create a SNS topic. So the topic that I would be creating is ah, okay, Published to sqs topic. So what I'm going to do is go to create new topic and I'm going to say publish to sqs stopping and I'm going to say s and s toe sqs and I'm going to select hit create. So once I'm done with that, the next thing that I'm going to do is go to the services section and type for sqs. I should see a simple que service open it in a new tab. And once you're there, it will ask you for a couple of questions saying how what Type off cue that you want to create. So for this lessons ah, scope you it doesn't matter which type of Q that you choose. This is basically saying if it is a standard que there is no particular order that you receive it in. Basically say, if you're sending some 1000 requests in tow, that particular que in the the order that you received that when you're pulling is not the same as that you have received in that particular que if you want to maintain a specific order than you would go ahead and create that folk you. But this is going to be a little bit off. This is a little right off how the 50 que works differently than standard cues. So there are There are its pros and cons, and we're not going to go much deep into there. So for this example of your going to select the standard Q and ah, once we select that and give a name, we're going to say, Ah sns to sqs killed and we're going toe select quickly it. So now our sqs is created here. We have to do a bunch of things to make it ready. Ah, to be used with business. The first thing is, we have to go and add some permission so that our SNS topic can actually send a message to this particular cute. So to do that first we need to do is select. Go to the permission, stab here and you need to select Add a permission. So once you do that, you'll have a attractive, um, an interactive screen where you can select what type of formations you want to give. So here I'm saying, effect allow, and I'm going to say Allow everybody and I'm going to select the specific action which is our send message action here. Now you can also go ahead and add conditions saying that I want to give only permissions to a specific. It's on this topic. I want to give only permission to a specific account number and so on and so forth. It's up to you are how you want to design this. But for this example, I'm just going to select everybody and I am going toe used the sent message of action. So and once I'm done with that, I'm going to select add permission. So once you are ah, once you've given the permissions, the next thing is we have to go back to our SNS topic itself, and we need to add a subscriber to this particular ask us, um que so to do that. First, we need to copy this particular Aaron, which is Sqs. Aaron. Once you copy that, go back to the SNS screen and select the topic that you want us that you've created, which is published to sqs and select. Create subscription. Now here. It's asking for you. Ah, for the in point. Ah, once you goto sqs, you'll ask for the in point. Which is your rescue rescue. Aeryn basted here. Once it is there, you can just select tree. It's subscription. Okay, so you have created the subscription. Now, refuse to refresh. You should see a subscriber coming up, which is your account number. So once this is all set up, what you want to do is, um you want toe also publish to Ah, you also want to create another subscription, which is going to be your email. So here. I'm going to say hash tag learning test at gmail dot com. And I'm also going to get my email up. And I'm going to Ah, wait until I get a message for subscription. So as soon as to ask your subscription. Ah, you have She was into subscribe to this topic. Okay, so I think I've already subscribed to this, and Ah, so I will be now going back toe this particular topic and refresh. Why does depending, uh, I get sick and firm? Chris? Confirmation. I'm going to go here. Okay, so I've got a subscription message saying that asking me to confirm the subscription now the subscription is confirmed. Ah, this is just for this example purpose, and it is not required, but just to demonstrate the use case that we've discussed. So now when we do a publish, So this particular topic, what happens is your email. We would get a notification right away, but it also goes to the sqs que and you will be able to retrieve that message whenever you are ready. So I'm going to demonstrate that as well. Ah, using the CIA life. So to publish a message, what we're going to do is set the published message button here. You can always do it from ah either Seelye or your application itself. Ah, Anyway, you want toe um triggered this sns but in this example, I'm just triggering it from the AWS console. So the subject, I'm going to give this SNS toe sqs push and I'm going toe begin. Also configure using Jason must a generator we haven't done in the previous lesson. So I'm just want to use this and show you how it is done. So what we're going to do s were going toe select email and sqs because, um is we don't want to use any other things here. So I've selected those both and I'm going to say this is my first as an SDU sqs message. Obviously, in your example that it would be more useful message. This is just our test. So if I do gender, it s and s I mean gender, Jason. It creates a farm right here. So it's goingto go ahead and publish this message toe the all the subscribers. So I'm just going to leave all the different options after this, and I'm going to segue published message. And once you do that, you should see that you've got the message I d. There. And once I go back to my, um email address and if I go back, I should see that a sentence to sqs push. That's the subject that we have put in there. And I got a message saying that this is my first as honest to sqs message. Now, this is not fun because this is not this We have done this already. In the previous examples, the fun part is going to the sqs and go to the monitoring or just hit Refresh. You should see that one message is available that you can pull this message whenever you are ready. And you can also see how Maney number off messages that I received. How many number off Mrs are saying this is outside the scope off this lesson, But I'm just going to I'm just showing you that you can also see this particular information coming up in the sqs monitoring tab. So now, to pull toe, pull this message manually. I'm going to use the AWS, Eli. So I'm going toe open up the power shallow prompt you can use to see command prompt or any other problem that you have. And I'm going to just search for aws sqs help. Now when you do that, it's going to show you bunch off options that you can use with this particular aws excuse Eli. And the one that we are interested in is the aws. Oh, excuse received message. So I'm going to copy that. I'm going to clear off the screen and I'm going to type again. Aws sqs Um and I'm with baseness, and I'm want to see how this particular see lies used. So if I just do help, I'm going toe see an example where I can just use how to use this aws sea life for sqs So you can see that there is an example here which is saying aws sqs receive ah message and so on and so forth. So I'm just going to copy all this and I'm going to come out off this and I'm going to paste. So it is saying maximum number off my suggest and I just want to pull one message and I want to Ah, see that. Okay. We need to keen our Q your A, which is of just going to be from our council for go back to the detail speech. You can see that there is a queue. You are here. I'm going to select that copy and I'm going to paste it here and ah, in the last thing that I want to enter is the region, which is region You rest one. And if I hit enter, I should see that my message should be retrieved, which is Ah, the message. Um, he's being published from published to ask us and we have got This is my first message, and we have got the subject s and s to sqs push. So we have successfully retrieved this message. And if you go back to your console and do a refresh, you should see that there is zero messages available because we have already agreed to that . So this is how you can use a Cenex along with sqs. And I really hope that this example might help you in building up your own use cases in your application. And, uh, thank you so much for watching. 13. Trigger Lambda function with SNS (Hands on Lab): hello and welcome back. So in the previous lessons, we have seen different subscription options for SNS and in this lesson, we're going to see how to use AWS Slammed of it SMS. So let's get started. So the first thing that I'm going to do is log into our AWS console. And once we're here, I'm going to go to the simple notification service now inside Simple notification service are we're going to go ahead and create a new topic. So the topic that we're going to do is SNS with Lambda, and we're going to say s and s it it's a mess. Lambda. Okay, so this is under 10 characters. Okay, so our topic is now created. Now what we want to do is whenever this particular topic gets a message pushed, we want Ah, that message Toby again redirected to our, um, to our lambda function. So to do that first we need to go ahead and create a lambda function. To do that, go to the services and search for Lambda and open it in a new tab. So once you're here, what we're going to do is create a new function and you can select from one off the blueprints or you can just order from scratch. In this case, we're just going to alter from scratch. And I'm just going to say, um, echo function, which is going to just take a water were it gets and it is going toe log into the cloudwatch locks. So I'm going to show you how to do that so we can just choose the basic execution role, choose an execution existing role. You should already see Lambda Basic execution role. If you don't see that, you can always go ahead and create a new role from template and you can choose from basic execution role. If you search for basic ah, you'll see the basic permission so but have already won created. So I'm just going toe, choose Lambda Basic execution and select create function. Now here. What I'm going to do is ah, I'm just going to say, uh, even is the one which, where I get the data that that the SNS publishers it do. So I'm just going to say before I call back. Callback is saying that OK, I'm done with this function and I'm execute. I'm exiting from here, so before that. What I'm just going toe do is console dot log and I'm just going to log the even know what this is going to do? Is it just going to print this into the into the cloudwatch locks? So if I just it's safe, it should get saved. And the next thing that I would be doing is jumping back to my AWS sns page and here we are going to create a subscription. Now, here you can just go and select the AWS lambda and from the functions you can select the equal function that we have here. So you have the echo function, you have the political lambda and once you're done, just create a subscription and hit refresh. OK, now you're subscribed and ready. So now what we're going to do is publish a message to this topic and see if our lambda gets triggered or not. So no select published a topic and say my first lambda treater and I'm going to say lambda , uh, being I figured from SNS and I'm just going to say publish message. Once I published this, this lambda functions needs to be get triggered and we can very fight out by going toe. Ah, dysfunction, Haykel function. And if you scroll down, you should basically see some monitoring starts on this. Oh, yeah, There's someone drink tap and you can see that your function was invoked one time, and I I'm certain that it is from our essence. And we can also see the logs by going toe cloudwatch logs go back toe the lock section here Once you go to the cloud wash and you can see that AWS Lambda Echo function has actually log here. And you can want to go to that locks and expand it. You should see that Ah, you've got a message with, say's even source is a deadly assassin s and you're even description is this and eso until subject And, uh oh, we didn't actually long distance subject here. So what we can do is now that we know that the cyst e response that we're getting from the S nous let's go back toe the lambda and write some more cord so that we can have our message logged toe the, um, toe the cloudwatch. So to do that, what I'm going to do is I'm just going to use this as my template. And I know that inside even I have the, uh, in that event, I have the even source records, some 100 records. I'm just going to say under zero record. And if you need theme the Sinise itself and let's see what this is going to look, let's it save and go back toe the SNS and let's publish topic again. Test message, test message and publish. And now let's go back toe the card watch logs and hit Refresh. It should see that the new ones are coming up. Ah, Okay, so the new one came up here, and if I hoping up, Okay. So yeah, So I have more descriptive message being long here and start off just even so now I have ah , the SNS, which is my test message and the message itself the test. And ah, this is how basically you can use SNS to trigger lambda and one off the use cases that you can apply this to is, let's say you have an auto scaling group and you have terminate weight policy where you have a life cycle rule triggered saying that a instances being scaled down there there is an option in the auto scaling group where you can say, Wait for so in so minutes. Let's say like 30 minutes before you terminate this instant and you want to do some operations within that time. So when the lifecycle changes to that particular terminate weight thing, you can trigger an essence. And that's Eskin Trigger Lambda Function, and you can go ahead and collect some important logs from that particular instance before it gets terminated. So this is one of the use case. But there are numerous other use cases that you can apply. Ah, by using, um aws sns along with Lambda. And I really hope that you like this lesson and I will see you in the next one. Thank you for watching. 14. Using SNS for sending SMS: hello and welcome back. So in the previous lessons, we have seen how to use a sin as toe send messages to different subscription options like emails, Lambda Functions or Sq excuse in this lesson. Let's go ahead and see how to use SMS as a subscription option. And I'm going to walk you through all the steps. So let's get started. So the first thing that I want you to do is log in tow, the, um, aws console. And once you're here, go go to the simple notification service and here again we're going to create a new topic. So there are different face you can use, Ah, a sentence to send in SMS message. And the first way is to basically create a ah SNS topic and ah ah, a subscriber are to your topic and publisher message. So we're going to try that now, and I'll also show you another way off sending SMS once we're done with this particular demo. So what we're going to do is go ahead and create a new topic. I'm just going to name it as ah SMS with SNS, and I'm just going to say, as a mass test and create a topic. Okay, so once you have your topic ready Ah, going to the topic itself. And now we need to go ahead and create a new subscription. So this subscription would be your SMS subscription. Select the SMS, asked the protocol and add your phone number. The important thing that you have to note here is basically you need Toki in the country cord where you want to send SMS to. Otherwise it will not work. So I'm just going toe key in my phone number here and I'm just going toe create the subscription. So once the subscription is ready, all you gotta do is you condone like we have done this in several other examples you can you can publish a message from different platforms. Ah, in this case, we're just going to use console to send the new SMS message. So I'm just going to select publish topic and here Ah, you can just do test SMS are and you can send a message as a mess from SNS and just select publish message. So once you do a publish message, you should si ah, a notification coming to your mobile that you have subscribed, and I just created this and I don't know if you can see this. Uh, it's kind of hard to show you this. What? I did get an SMS message published my phone. So this is how you do it of it when you when you want to send the same message to multiple people, let's say you have 100 or 200 phone numbers that you want to send. So in that case, you would just add those 200 phone numbers to your subscription list. So that particular topic and then you just publish it. Publish a message to the topic, and the topic will make sure that your message is delivered to all those 100 or 200 mobile number Start. You want to send that notification toe the other way is to, Ah, just go ahead and send some promotional messages. Or send a one on one message from your particular, um, obligation itself. Like let's say you want to send a message like, Ah, one time password or you want to send some promotional message to a specific user where you don't have warned like 100 different users to get the same message. Then Ah aws SNS also has option toe basically for that particular use case. So all you gotta do is go to the text messaging section in the left side menu and you can go and ah, select the options and the text message, and you can select what type off message, whether it is a promotional order transaction. Ah, the only difference between promotional and transactional messages. Basically, promotional message. Our scent of you, like less reliable networks and transactional messages are sent. We are high level off reliability because it is really important for your one time passwords are like bank related reset password information that that's being sent. So it's a sentry. Ah, high, really highly reliable network. So that's the only difference here. And you can ski in your phone number and you can send the message. Are you concerned the message and you can just give the same ready Sandretti would be just , ah, the whatever the sender name that the mobile phone sees. That's what you can key in here. So once you put in all that information and click the button sent text message, your masters should be daily word and ah, I know that most of the obligations you wouldn't like manually do it from the console. But there is also option for you. Do ah send these SMS using ah, audibly assess tickets or edible your Seelye or any other platform where AWS offers you? D um SD Gates anti allies. So that's Ah, that's how you send SMS messages. And the other thing that I want to also mention here is basically you can also said the prayer Ah, preferences for your specific ah, message types like for promotional. You can you can tell how much limit you want to spend on that particular promotional messages. And you wanna have cloudwatch logs for this and so on and so forth You gonna break those preferences like voice. You can also have preferences for the transactional type SMS. So that's it for this part. And I think, ah, you can also have, like, operate out phone numbers where, and you can say, OK, I don't want to send SMS to this particular phone numbers, and you can have those particular phone numbers also recorded here. Ah, In that case, even though you send ah semester a specific number which is opted out then that's going toe . Not AWS. SNS is not going to deliver messages to those four numbers. So that so That's about it for ah, using, uh, abuses and has to send SMS. I really hope that you like this lesson and thank you so much for watching. 15. SNS Applications overview: hello and welcome back. So so far we have covered a lot of ground on simple notification services. And in this lesson, let's go ahead and take a look at the SNS applications. So to do that, first we need to go to the simple notification service in AWS console. And once you're in here Ah, go to the application section. Now let's talk a little bit about what SNS applications are and how weaken, uh, leveraged this particular this particular feature into our applications. So basically, ah, SNS applications eyes a platform for you to enable push notifications to your applications . It can be anything it gave me an IOS up. It can be an android up windows phone app or a Mac book application or a Kindle obligation or anything. But, ah, the only thing here issue. You need to, ah, create a platform implication in SNS, and once you have that, you need to also create credentials where you're going to use it in a particular device. Let's say if you're using, if you want to push a notification toe and our device, you need to create something. Ah, some credentials in the Google Cloud messaging and then you have tow hook that credentials up in in the, uh, in this particular SNS applications platform. And then you can use the sdk aws sdk offered for that particular language toe. Send a push notification to the specific particular mobile platform. Very. Your application is being hosted. So I'm just going toe walk you through the steps that you need to require that you need to take care to create this particular thing here. And we're not going to go ahead and like, toe each and every step where you create a mobile application and demonstrated push notifications That's that's really are off scope off this. So I'm just going toe, give a brief overview. So to create a ah platform application here, all you need to do is create click the button and once you're here, you need to select the type of platform where you want to push. Oh, if it is like the apple Apple has production and development. If it dislike for android in China, or Google Cloud messaging our Microsoft in pianist for Windows phone seven and so on and so forth. Whatever the platform that you choose, you'll have, like, different Ah type of information that you need to key and for us, we have this particular options that will be created once you have. Ah, the specific. This should be created in the developer portal off Apple Developer program. And if you're choosing global clark messaging, it will ask you to keep the A P I key and so on. There are different options here. And if you want to learn more about this once you are in this page, you can select this part and learn more, and it will show you, like for that particular platform. Like if you change this particular platform toe apple production, then it will show you information about apple production, and you can follow this simple steps and you should be able to get started with SNS applications. So ah, that's it for this particular lesson. And thank you so much for watching 16. SNS Pricing: Hello and welcome back. So far Ah, we have seen a lot of things about AWS SMS. We have seen how to use us and s one of the different use cases and so on and so forth. In this lesson, let's go ahead and talk about how much does it cost to use this particular SNS Ah, eight of your service. So let's go ahead and take a look. So to rule, get to the page where ah, you can see the pricing information. All you gotta do is open a Google search and just do era bs SNS pricing And the first thing that appears usually will show you how much it costs for using this particular SNS. Now, if you are under a free tier, then I'm going to say that you there wouldn't be any cost for you because ah, the feet ear covers a lot off. Ah ah Nordoff request that you can use it for free now. Ah, coming toe the publisher section. You can read through these particular documentation here, but the or view is if you are doing your mobile push notifications using SNS applications, then you get one million Freedia. Um 32 year push notifications. And after that Freedia limit, you're just going to be charged 50 cents per 1,000,000. That's that's a lot off. That's that's That's very cheap compared to the amount off push notifications that you're sending now. If you're sending a worldwide ah SMS 1st 100 as a mess for your free deer are free and if you are using it ah, outside the Freedia limit, I'll Ah, the depends on like the type off, the different on the country, where, from where to where you are sending this SMS Now. If you're considering United States, then you have 0.645 for Transactional SMS, and it's the same for the promotional SMS as well. And ah, you can search for any other country. Let's say India and you can see how much it costs to send an SMS in particular country. Now that's the cost off, that surprising for using SMS and let's go back to the other options here. Now, if you're sending emails, the three tier will cover 1000 free emails and um, if you if you are sending ah outside the Freedia limit than it is just $2 per 100,000 emails. And also this is not a lord at all. And the other one is the https. Ah, and points. And it is also covering 100,000 Freedia requests. And after that it is a 0.60 dollar per 1,000,000 extra DP calls that you're going to make from the S and s. And for simple que service and lambda functions, there is no charge because it's it lies within the AWS ecosystem. AWS does not charge you for those. And, um, the other information is like we're not sending any data out, so Ah, so this should not be too much. And most, most probably your Freedia should cover all of this information if you're using just very less so Ah, that's all about the AWS sentence pricing. And I hope that it is not really much off a cost. And I really appreciate if you guys start using s and s in your obligations as free dear covers a lot off it and ah, that's it for this lesson. And thank you so much for watching 17. Part 1: Publish to SNS from Nodejs application: Hello and welcome back. So this is a pretty exciting lesson. And in this lesson, we're going to see how to use the S and s from no Js application. Now lets get started. So let's talk about some off the requirements that you need to follow along with this lesson. So the first thing that you need is ah to install no Js sdk onto your computer. Oh, I'm not going to cover that part because that really doesn't come under this course curriculum. It's basically very simple. All you need to do it's like google the note STK and then you download the latest version Install it. It's a simple installer and you're done now. Ah, once you're installed with no Js application, I mean no Js sdk the next important thing. Yes, you need a user created in your AWS account. Oh, and you need to create the credentials, access key and Secret Access key download it and keep it in the fight and the next ah requirement that you need is basically a SNS topic and we're going to cover all those things. Ah, now, right now. So ah, let's get started. So the first thing that I'm going to do is basically log into our my AWS console. And I am going toe, um, use the topic which were which we have already created So we can use this first lesson this topic and we already have a subscriber, which is hashtag learning tested gmail dot com. So I'm just going to you reuse this particular topic in my example. So if you want, you can create a new one that's up to you. So the next requirement that we need is basically you need to create a new user. I'm just going toe create the user, saying, um s and s publisher and I just need the programmatic access. I don't need the consul access because this is being used from the S and s. Um, I mean, the application itself. So we can just ah, for now, you can use ah, business. Um, you desk usns full access for now, But always make sure that you ah, create a policy which just allows the user to publish toe the topics and not anything else . Um, you know what? Actually, let's go ahead and create that policy as well because that's a good practice. So let's not attach this policy and said, Start, I'm going to go toe I am section go to my policies and let's create a policy. So let's say we want Ah, this to be running with SNS Select destined us here. Select actions that do you want to do? Let's less here. Uh, we don't want to list anything we don't want to. I don't want to change any off thes. We want to topic we want to publish, right? We want to publish from our application when we don't want to do anything else from that from that particular application. So I just said the publish and for resource, I'm going to say all resources. So I want this obligation to be able to publish to all my resources. If you want to specify a specific one, it is up to you. But for this example, I'm just going to leave it as all the sources. So once that is done, I'm going to review my policy and I'm going to name it. Ah, as policy as an ask publish. Ah, published on Lee all and I'm just going toe hit Create policy now Our policy is created and ready. Now let's go back to our previous screen. Do a refresh. Um, and then just select the SNS publish only the one which you have created and select next review. Oh, I think I didn't click the select this, so I wanted these, like this one, just like the policy that we have created it. Next review Create user. Okay, so now your user is creator and ready, and I'm going to download my credit. Chills toe my ah, downwards, Fuller. So now that my access keys and secret access key already, let's go ahead and ah, check out if our note sdk is ready set up in my computer or not. So to do that, all of all you need to do is basically open. A power shell prompt are a command line front. And all you need to do to very fire is basically you can say no to ah, dash version. Uh, no note. Dash me. Yeah. So if you just type no, dash we, then it will show you which version you off. No. Do your running. I'm on 8.9 point four. Yours might be different because you might update You might just download the latest version then or you might have a previous version. It doesn't matter because we're just going toe, do some basic operations and no diversions really doesn't matter for our example in this case. So now that this is ready, all we need to do is basically go go and create a particular fuller where you want your ah example Toby created. Now I have a fuller created here already, so I'm going to navigate. So that folder Ah, this is not in courts. That's why this is complaining. Okay, so I have navigated toe this particular fuller and here I'm going to create my node Js application. So to do that, all you need to do is basically do in pm in it and then hit Enter. Now it's going to ask us a few questions about our application. I'm going to name this package name as SNS node example, and I'm just going to leave the default. This is a test of application for S and s an entry point this index charges or we still haven't created that index yard. Here's what We're going to create it and then the next step so we don't give any test commands we don't want to give. I'm just giving my name here. Just leaving it. Yes. So this is okay. So now we have, um, that packaged or Jason created where we specify our requirements and our our application related properties. Now, what we're going to do is basically, um, open up this particular folder in the, um this particular fuller in the visual studio accord you can use any other co editor like some sublime texts or nor pad plus plus or any other accorded off your choice. Now, here we have this particular packaged or Jason, and the next thing we need to do is basically, you see that you have specified that main fighters in next R J s. Now I'm going toe create that particular file here. Let's create index dark, Jess. Okay, so now we have our ah, package start Jason created. We have our indexed r j s created. The next thing that we need to do is basically, um, specify are dependencies, which is our aws s ticket. Because we don't want to write a complicated court that does, like http calls toe ah audibly services and manage it ourselves. But ah Aws has already created the STK with just a simple ah npm package that you can add to your know Jess application. And it is it is, like, very well documented and it is very simple to use. So now we're going to add that particular AWS sdk as a dependency to this application and we're going toe are due in PM install so that it our application has that particular dependency downward. So to do that, all we need to do it's like here, add on the block which is basically going to be our, um, dependencies. And inside this, we're going to do AWS Stashes decay, and you can go with the latest worsen a few. If your application is sensitive, toe version changes. You can always specify the version that you are stable on and you can use that. If not, you can just go ahead with the latest portion. So once that is done, all you got to do it's like it save and open up the power shell hear from here and do in PM installed. Now, once you do this, NPM install and PM is going to dollar that particular AWS sdk dependency and add it to your ah project. Now, if you go back to your visuals, really accord, you can see that the note models have been updated with STK and its dependencies are also downloaded and saved here. So I'm going to pause this lesson here because it's getting really long. So ah, that's it for this lesson. And in the next lesson, we're going to continue with this particular example and we're going to show you how to use no jails toe basically publish the message to the US and stopping so thank you for watching . 18. Part 2: Publish to SNS from Nodejs application: hello and welcome back. So in the previous lesson, we have created our ah no Js application and we have created our AWS user that we're going to use with this particular application and we have the topic already created. So in this lesson, I'm going to walk you through Ah, how to use the, uh, aws javascript plastic. And I'm also going to show you off how to look up the documentation and so on and so forth and let's get started. So the first thing that I want to show is basically ah, the SNS documentation that is available in AWS Um basically are to get to this, um, link, I can pull. I'll post you this link in the resources section. But usually the best way to do it's like just do a Google search off, saying, um s and s javascript STK and you'll basically land on this speech. We're just going to show you ah, how to use this particular SNS in the job script library. So you can see here like how to initialize how toe I used with different methods, the one which we are interested in this basically the subscribe. So you can just go to this particular thing and then we can see, um, the examples here and then we can grab one example and then we can work off on that. So So let's go back to our ah visual studio quarter deter and let's get started. So and there's one more thing that you need to know is basically when you are using AWS services from within your application, there are actually multiple ways off. Authenticating yourself with that service by meaning. What I mean is basically, um if your application is hosted within the AWS ecosystem like he see two instances, then you don't need to worry about putting the credentials of the access keys and tickle access key embedded into your application because you can always assign the city rule. And, ah, without specifying any credentials in your application, your application would automatically detect those. And that s the cable automatically work with you if you're ah, role has that particular permissions. So that role needs to be assigned to that particularly see to instant now. Ah, the if you're if your application is not hosted in AWS ecosystem and afraid it's on its own . Ah, if it's on your own. Ah, infrastructure like on premise infrastructure. Even then, you can use the s and s are the AWS services from from your application using the access key sent secret access keys Now for for this use case we're going toe consider that we're running out of the AWS ecosystem And that's why we created our user already in the previous lesson. And we're going to use those access keys and secret access keys. Eso that's it for the introduction part loan. Let's go ahead and write some court. So ah, what we're going to do it's like basically goto our, um index start html page and, um here we need to import our STK first. So to do that, all you need to do is basically first you need to write this You strict s o This is the node.js thing and we're going toe include Ah no We're going to save our yes equal. It's required We need to import the STK that we have already done. So I'm going to use this now. Your aws um is imported into that variable. The next step that you need to do is basically I'm just going to write the function of it is going to be Ah, sand SNS notification. And inside this, we're going toe, um, lowered the credential snow for loading the credentials. We need the credentials to be already present in our application. So what I'm going to do is basically I'm going to create another file in here, and I'm going to say Ah eight of yes, config dot Jason. Now, inside this what I'm going to do is basically I'm going to ah, put in my access keys and ticket access keys, as I'm going to say access key access key I d. Equal something secret. Secret access keys. It's something. And we need the region where we're working off off, and I'm going to choose you West one. Now, um, let me pass this and fill this up with my crowd and chills because I don't want to expose those, But you just need to use the grandchild's that you have ah, downloaded in the previous lesson. So I'm going to pause it for a second here. Okay, so now I have saved my access keys and equal access keys in the template that we have just written in the aws conflict gorgeous and file. And now what we're going to do is basically import that credentials file and load into the AWS sdk so to ah, the way this done is basically you reference this aws dot um confected art lord from but And here I'm going to just give ah dot slash What's that? Aws conficker dark Jason. So now you're STK is loaded with that particular credentials that you have supplied The next time that we need to do is basically we can go back to our ah sns example here or in the stick if STK ah documentation and let's see how this can be used. So let me go to the top and um let's see how to actually use this So we're going to copy this Ah, this spreading the line here and inch lies RSS and let's see how to use thesis ups of publish published thing. Okay, so now you can see that the published example has ah, all these parameters that you need to pass in Ah, in our example weaken. Just copy this particular parents and we can only fill in those problems that that that is required for our particular application. So what? What we're going to do is basically we need the, um, my stage itself. So we're going to say this is our test. That's a master message from job script and in the message attributes basically acted. I think we don't need the message attributes because we just want to publish a message from here. So I'm just going to get it off this particular block, Um, from the this particular entire block because we don't need that. And inside the subject, we can say test. It's an S from job script. We don't need the phone number. We don't need the message structure. Um, we should we need toe either to stopping Aaron or target Aaron. And in this case, we'll choose the topic, Erin, because we have already created the topic. Now we're toe get the topic information, go back to your AWS sdk, and you can see that this is our Aaron. So I'm going to copy this Aaron from here, and we're going toe basically. Ah, paste it here and once started. Done. Oh, well, uh, no. Uh, use this to use this patterns and send it in the in the call that we're going to do. So what we going to do us? We're going to do SNS start, publish. And inside this we're going to send the parents that we have created and we need a callback function. So we're going to say error, comma data and this is the standard nor Js callback function. And here, if our message was successfully deli word, if if there are some enter, it's going to come back and center. So I'm going to log it as, uh at our message and else that means that the if it's not better than it sucks is then we're going to get back some data. So I'm going toe log saying that success fully published, and I'm going to say consoled or log the data that we got back. So now all we need to do is basically call this particular function from outside and see if that works. I'm going to just do this guy and I'm going to. It's safe now. Are toe basically test? This application while we need to do is again go back to our partial, prompt me clear this year, and we can just do ah ah, we can just do node in that start Js and you can see that it we got back the response successfully published We got back the the response of just the metadata and the request I d ah. And now let's go back toe my email address and let's see if I got that message delivered. Okay, so here's my email. Well, let me refresh. You can see that I got my first test sns from Js and this is our first test SMS message from Yes, and that's pretty much it. So we have now successfully posted a SMS message from our application, which is outside the, uh, AWS equal system. And you can see it for yourself that it is very simple and it is very easy to use. So that's it for this lesson. And I will see in the next one. Thank you for watching 19. Conclusion: Hello and welcome back. So this is our conclusion lesson for this particular course. I really hope that you guys enjoyed the course, and you have a lot of ideas where you can implement the SNS in your applications and as a developer, as well as as a native liest administrator. Now, if you end up having any questions, are any queries related toe, simple notification services or any other AWS services itself? You can always email me at Millard Rate cycle and nothing dot com are Ah, you can also email sent a message in the, um, e portal itself. And, ah, if you are looking for ah, more courses from me, then you can check out my profile in your enemy and you can go and check out the different courses that I offer. And ah, here's a discount code, uh, that you can use with all my courses so you can just use discount 15 99. And, uh, that will be, ah, valid for all my AWS courses. So that's it for this lesson. And, uh, thank you so much for watching 20. BONUS - Setup IAM with AWS CLI: Hello and welcome back. So this is an exciting lesson. Where of you're going to install our AWS, Eli, and we're going to create our first AWS of access keys and secret access keys, and then we're going to test some aws eli comment. So let's get started. So the first thing that I'm going to do is basically log into my console as an administrator user that we have created in the previous lessons and ah, and we're going toe down. Lordy. Oh, aws Eli Now. So ah, So Donald, the AWS Eli, all you can do it's like basically, go to your go to your browser and then just do a search for download a WSC ally for Windows . Or if you're if you're using a Mac, are ah the next. Then you can basically download the appropriate operating systems portion. Now I'm using every notes operating system, so I'm just gonna choose 64 bit windows installer, and I am going to download it in a downwards. Fuller. So once this download is complete, all we gotta do is basically a simple installer. You just have to hit next and then choose your Donald location, and you would be done. So my dollar is not complete. I'm going to open it up and I'm going toe just hit next except license and then just hit Install. Now it's just going to take like, ah, less than a minute to install this aws. Eli, once it is installed, you can basically open up your power shell or a command line interface command prompt toe test if that's installed successfully. So I'm just going to open up a power shell. Oh, I'm I like using partial. You could use your ah choice off command line interface Command prompt are partial. It should not matter. So I'm just going to do basically aws help. And if something comes up, then that means that my, uh, aws Eli is installed properly. So let me keen that. Okay, so I got back to help options. That means that our aws allies ready on installed properly. Okay, So the next important step now that we're going to do is basically create our access keys and ticket access keys for this administrator user, and we're going to configure it to our probably a sailor. So let's do that. So to do that first, you need to go to your AWS console and then you have to go to your I am services. So inside this you go to your administrator user. I want to create it for my administrator user. So all you got to do is go to the users and you can go to the admin state of here and under security credentials, you should see that there is no ah access keys created for this particular user. So all we got to do it's like, select create access key and it will be created. And this has, ah to access keys. One is access key and another secret access key. Basically, it's like a user name and password. But you have to make sure that you keep them very secure place. Because once someone gets hold off these access keys and Tikrit access key, then that means that they have the entire consul access or they have the entire AWS access and they can do pretty much everything that you can do. So ah, be careful with this hand story to never be secure place. Now what I'm going to do is basically ah, select this. I just don't know these access keys in a folder, and then I'll just save it for future efforts. So the next thing that you have to do it's like, now that you have access keys and take your access keys. Ah, you just have to bring up your power shell back and you need to execute the following comment. So it's It's a simple command, which is ah aws conficker. And then you just give a profile him and ah, this profiling makes it easy for you, toe. Ah, recognize which aws? Ah, um user that your conficker and of to be to be specific about which user you are choosing toe execute the following comment So let's go ahead and set up our access key centigrade access keys. Now all I'm going to do is basically execute this command. Let me clear the screen And here I'm just going to do aws con figure and I'm just going to give that stash profile and I'm going to give this a name. So I'm going to give adman Dash Oh, or else hashtag learning test dash admin. You can give your own name here and it's up to you. So the next thing it's going to do this once I hit Enter, it's going to ask me for the AWS access key. Now the AWS access keys basically the access key that we have generated here. So I'm just going toe copy the access key and I'm going toe based it here. Now I'm going to open up my secret access key here, and I'm going toe Put it in a I'm not going to show that secret access key anyway, so I'm just going to delete delete it after some time. So, uh, let me just copy that my other screen and then pull this back up. Just going to hit enter. It's going to ask me for the secret access key. I'm gonna base the secret access key and then hit Enter. So the default region is Basically I would like to work in the Atlanta region, so I'm just going to give you West one. You can choose your own region. Basically, aws are several different regions like we've discussed in the previous lessons. So I chose the island region, which is your best one, and then I hit enter so I can leave the default out pron option Toby None And now we're all set and configured with our AWS See a lie. So that's it for this lesson. And ah, in the next lesson will test some aws see like amount and see fee If it works for us and ah ah, let's play around. That's it for this lesson. Lt in the next one. Thank you.