08. Lab - SNS
# SNS
In this hands-on exercise, you will learn how to send alerts via SNS by creating a topic, subscribing to a topic, and publishing an alert message to a topic.
Prerequisites:
- AWS Account
Topics Covered:
By the end of this lab, you will be able to:
- Create a topic
- Subscribe to a topic
- Publish a message to a topic
Steps:
- Create a Topic
- On the AWS Management Console page, type
snsin theFind Servicesbox and then selectSimple Notification Service. The SNS Dashboard appears. - On the left-hand menu, click on
Topics. - Click on
Create topic. - Enter a name for your topic in the
Namefield. - In the
Access policy – optionalsection, for theDefine who can publish messages to the topicsection, ensureEveryoneis selected allowing anyone to publish to the topic. For theDefine who can subscribe to this topicsection, ensureEveryoneis selected. - Click
Create Topic. The topic screen will display.
- On the AWS Management Console page, type
- Subscribe to a Topic
- Click
Create subscriptionfrom theSubscriptionssection. - For the
Protocolfield, selectEmail. - For the
Endpoint, enter the email that should receive the notifications. - Click
Create subscription. - The subscription page will display and the status will be
Pending confirmation. After your subscription is created, you must confirm it. - In your email client, check the email address that you provided for the
Endpointand choose Confirm subscription in the email from Amazon SNS. - In your web browser, a subscription confirmation screen appears.
- Click
- Publish a Message to a Topic
- From the menu on the left-hand side, click on
Topics. - Select the topic you created earlier and then click
Publish message. - Enter a subject in the
Subjectfield. - Enter a value in the
Message body to send to the endpointbox in theMessage bodysection. - Scroll down and click
Publish message. - In your email client, read the email from Amazon SNS.
- From the menu on the left-hand side, click on
Send alerts via SNS
Task Feedback:
Amazing Work!