Guided Lab: Amazon SNS Email Subscription

Description

Amazon Simple Notification Service (SNS) is a fully managed messaging service that allows you to send notifications via multiple protocols, including email. This use case is particularly useful when you want to notify a group of users or systems about critical updates or events.
In email subscriptions, you can use SNS to automatically send notifications to subscribers’ email addresses whenever an event occurs in your application. This feature is often used in monitoring systems to email administrators about potential infrastructure or service issues.
Imagine an e-commerce platform wanting to notify its system administrators and customers about order statuses, payment confirmations, or inventory changes. These notifications should be sent in real-time through email. The platform can set up an SNS Topic with an email subscription, allowing it to broadcast updates to all subscribers efficiently.
In this lab, we will simulate subscribing an email address to an SNS topic and test how notifications are received via email.

Prerequisites

This lab assumes you have the following:

  • Basic knowledge and understanding of AWS services, particularly Amazon SNS.

If you find any gaps in your knowledge, consider taking the following lab:

Objectives

By the end of this lab, you will:

  • Subscribe an email address to the SNS Topic.
  • Simulate sending a message to the SNS Topic and observe the email notification.
  • Confirm the subscription via email and publish messages.
  • Understand the SNS message delivery process.

Lab Steps

Create an SNS Topic

1. Navigate to the Amazon SNS Console.

2. You will be directed to a SNS dashboard.

3. To create Topics, look for the Topics in the left-sidebar. Then, click on Create Topic. Follow the configurations below:

  • Choose the Standard type.
  • Enter a name for the topic, such as “TD-Topic” (as shown in the first image).

  • Click Create Topic.

Kindly ignore the “Couldn’t retrieve data protection policy” warning. You can safely finish this lab even without this policy.

Create an Email Subscription

1. Look for the Subscriptions tab on the current dashboard and click Create Subscription. Follow the following configuration:

  • Topic ARN should be automatically entered.
  • For Protocol, select Email.
  • In the Endpoint field, provide an email address to receive notifications.

  • Click Create Subscription.

Confirm the Email Subscription

1. You will receive an email from AWS SNS to confirm the subscription. Check your inbox for a confirmation link.

2. Click Confirm Subscription.

3. Once confirmed, the subscription status in the SNS console will update from Pending Confirmation:

  • To Confirmed.

Publish a Test Message to the Topic

Test the email subscription by publishing a message to the SNS topic.

1. Click Publish message in the SNS console. Follow the following Message details below

  • Subject: “Email Subscription SNS Topic Test” 
  • Message body: “Tutorials Dojo proudly made in the Philippines”

  • Click Publish message.

2. After publishing, check the subscribed email inbox. The message from SNS should arrive with the subject and message body specified in the publish step.

Congratulations! You explored the full process of setting up an Amazon SNS email subscription, from creating a topic to confirming an email subscription and sending test notifications. This functionality is highly useful in real-world applications, enabling efficient and automated message delivery across multiple endpoints, such as alerting teams, notifying users, or triggering workflows based on critical events. By using SNS email subscriptions, businesses can ensure timely communication and improve overall system responsiveness without manually managing notifications.

As a best practice, remember to delete any resources no longer in use, such as SNS topics and subscriptions, to maintain a clutter-free AWS environment.

Thank you for joining this lab, and happy learning!

Skip to content