AWS Essentials: Guideline SNS Basic on AWS

Tram Ho

Continuing with the series of articles about Basic AWS Setting, we continue to learn about SNS (Simple Notification Service).

1. SNS concept

This is a service of AWS that allows users to automatically send emails, text messages or push notifications to mobile devices based on the user event settings on the AWS Account side.

Another more technical definition, SNS is the service that coordinates and manages the sending and receiving status of messages to registered endpoints as well as to enduser. In AWS SNS, there are 2 types of clients: publisher and subscriber , respectively with the provider and the consumer.

Publishers communicate following an asynchronous protocol with the subscriber side by creating and sending messages to a topic, a logical access point and communication channel. Subscriber (ie, web server, email address, Amazon SQS Queues, AWS Lambda function) will receive messages or notifications through a supported protocol (ie, Amazon SQS, HTTP / S, email, SNS, Lambda) already registered earlier.

2. SNS Workflow

SNS Service is very important in automating the process of monitoring the system in case any errors occur on the AWS side.

For example:

In this example in case EC2 crashes:

  • Cloudwatch side will detect errors based on error prefix log prefixed for critical errors (eg error.production.prefix)
  • At the same time, Cloudwatch will automatically trigger the CW alarm
  • CW Alarm will trigger an event to send an EC2 crash error message to the System Admin for action to fix the error as soon as possible

3. Basic components of the SNS and Pricing option

3.1 Basic Components

Basic components of SNS include:

  • Topic: A place to label and group endpoints to send messages to
  • Subcription: The endpoints for the topic to send the message to (eg, email address, phone number of the system admin)
  • Publisher: Person in charge / Alarm / Event setting message to send by SNS.

3.2 SNS Pricing

How will we be charged when using SNS?

  • Publisher: Charge by number of SNS requests (Number of messages ie need to send)
  • Notification delivery (Push notification): Will be charged according to the number of device messages sent.
  • Data transfer IN / OUT of SNS

Pricing details: https://aws.amazon.com/sns/pricing/

4. Steps to use SNS Service

Basic steps to use SNS Service:

1. Create topic:

  • Add name and click “Next”

  • For SMS (Text message endpoint), add display name is required.

  • Click Create topic .

2. Add subcriptions:

  • Select the topic you want to add subcription .
  • Click Create subcription .

  • Choosing a protocol protocol (based on endpoint)

  • Select Enpoint

  • Click Create Subcription .
  1. Publish topic:
  • Click Publishing a topic
  • Enter the subject content and message
  • Click publish message

I will end the SNS setting topic here, see you in the next topic about Setting ELB.

Share the news now

Source : Viblo