Hey, everyone.
And welcome back.
Now, in today's video will be discussing about the simple notification service.
So the simple notification service also stands for SMS is a fully managed messaging and mobile notification
service by us.
Now, the SAS can be better understood with this architecture diagram over here, where on the left
hand side you have a publisher on the middle, you have a SNS topic and on the right hand side you have
the subscribers.
So the basic idea here is that whenever a publisher sends a message to this same topic, SAS topic will
in turn forward that message to all the subscribers who have connected with that SNS topic.
So this is the basic idea.
So your one great thing is that if you do not have a sense topic, your web application would need to
have a logic to send message to each of the endpoints.
So SNS supports endpoints like SMS notifications, email, HTTP, HTTPS, lambda, and so many others.
So instead of adding all the logic in the web application, all you have to do in the web application
is to forward the traffic to and topic and let s handle all the backend things which are required to
send the message to various devices.
So let's do one thing.
Let's jump to the practical and look into how this can be achieved.
Now I'm in my management console, so let's go ahead and open up the SAS service.
So this is how the joy looks.
Now what you can do, you can click on the left hand side.
There are three buttons here and you can go to the dashboard.
So in the dashboard it will basically give you an overview about the topics.
So let's go to the topics over here and let's create a new topic.
So currently what we are doing is we are creating this new topic first.
So let's call it as labs hyphen SAS hyphen topic.
Let's also give it the display name and we'll go ahead and create a topic over here.
Great.
So our next topic is created.
The next step is to subscribe the endpoints.
So if you look here, there is a button for create subscription.
So let me click over here and the protocols which are supported here are http https email, excuse lambda.
You have SMS and you also have a platform application endpoint.
So this is basically required for notifications.
So let's do one thing.
We'll be using two protocols here to look into how exactly SSNs would work.
So let's first select email and I'll quickly add the email address where I would like to receive the
notifications.
So once you have done that, you can go ahead and create a subscription.
Now here you will see that within the status it is requiring a confirmation.
So unless and until you do not confirm it from your email address, this status will not change and
the messages will not be delivered.
So this is required for email.
So let's go back to the next topic here.
So currently you see that one is in the pending confirmation stage.
Let's create one more subscription.
This time we'll select the protocol of SMS.
So within here, within the endpoint, you will have to add a fully qualified phone number which includes
the ISD code.
So let me add mine.
And once you have done that, let me go ahead and create a subscription.
So for SMS, you will see the status is automatically confirmed.
So you do not really have to explicitly confirm the subscription for SMS.
So the next thing is we have to confirm the subscription associated with email address.
So within my email you will see that I have received a subscription confirmation message from us.
Always verify the topic.
And so before you confirm, because in organizations there can be hundreds of topics.
So before you confirm, always verify the name of the topic that you are subscribing to.
And once this is good, you can go ahead and click on confirm subscription.
Great.
So the subscription has been confirmed.
And now if you quickly refresh this page, you should see that the status associated with both the subscription
is confirmed.
So now what we have done, we have created a snooze topic and we had added the second and the third
option, which is SMS and email.
So the last thing that we need to do is we have to send a message to a sense topic so this publisher
can be achieved via the console itself.
So there is an option of publish message here.
So this is one way.
Second way is even if you go in the main console and you select the sense topic, you have the button.
Collect publish message so you can publish the message from the console.
So let's give it a name.
Let's say KP Labs message.
So this is the name and within the subject you can say, this is my first SNS notification.
All right.
So that's the only thing which is required.
Once you have done that, you can go ahead and click on publish message.
So if you have heard the notification, that is through my mobile, let me quickly show you.
So if you can see it over here, you see this is basically the SMS which has been received, which contains
the exact contents I hope you are able to see.
So that is the SMS part.
Now, even in the email you will see that I have received the email the subject Escape Labs message
and it has a message containing This is my first SMS notification, so I hope you got the basic idea
about what SMS allows us to do.
So there are a few important things that we need to remember.
First is that a cloud watch integrates well with SMS, so you can integrate the cloud, watch alarms
that you might create with the same topic.
So for example, one such alarm would be whenever disk usage of your server exceeds 95%, then send
an email and SMS notification to the NOC team member or to the on call member within your organization.
The second example use case can be whenever a server load in production is more than 90%, then send
an SMS and email notification to the appropriate team lead.
So once they receive an SMS as well as email, they will be able to work on it quickly.
So these are some of the example use cases which can be achieved whenever you're integrating the SMS
with cloud watch.
Now, before we conclude, there are a few important things that I would like to show you.
So the first important thing is that SMS can also be used to send push notification, so you might have
seen such push notifications within your phone.
This is pretty common nowadays.
So in exams many times the question will say push notification so you'll have to identify the keyword.
So if there is any requirement where push notification needs to be sent, then SMS is a great service
which can achieve that.
So this is one important part to remember.
Second important thing that you need to remember is about the supported region and countries.
So if you will see your these are basically the list of regions which has within the documentation.
So always go ahead and check the supported regions before you enable the SMS functionality.
Apart from that, you can face a certain SMS delivery failures.
In fact, this is quite common because whenever we used to implement SMS within our production environment,
there are certain people to which the SMS never got delivered.
So this is a pretty common scenario that you will find within the organization.
So an SMS can be blocked due to various reasons.
One is that it can be blocked when your phone courier is identifying that SMS as a spam or a destination
is blacklisted or maybe a message board is invalid and so on.
So there are a plethora of reasons due to which SMS delivery can fail.
So whenever you are making use of SMS within the production and you are planning to heavily rely on
the SMS functionality, you will have to verify whether it is working perfectly or not.
There are also cases where a SMS message, whenever sent through the SMS endpoint, are delivered pretty
late, so they are delivered maybe four or 5 hours late.
So you always have to take into consideration these things before you implement it in production environments.
Great.
So that's the overview about the Simple notification service.
I hope this video has been informative for you and I look forward to seeing the next video.