Creating an SNS Topic and a Subscription

Lab Steps

lock
Logging in to the Amazon Web Services Console
lock
Creating a New CodeCommit Repository
lock
Creating an SNS Topic and a Subscription
lock
Implementing a Lambda Function to Process CodeCommit Events
lock
Connecting to the Virtual Machine using EC2 Instance Connect
lock
Testing the CodeCommit Trigger
Need help? Contact our support team

Here you can find the instructions for this specific Lab Step.

If you are ready for a real environment experience please start the Lab. Keep in mind that you'll need to start from the first step.

Introduction

Amazon Simple Notification Service (SNS) is a highly-scalable, reliable, secure, and fully-managed service that enables applications and third-party services to communicate with each other.

In this lab step, you will create a topic in SNS and create an email subscription. An email address you can receive emails at is required to complete this step.

 

Instructions

1. In the AWS Management Console search bar, enter SNS, and click the Simple Notification Service result under Services:

alt

Note: Please ensure that you are in the US West (Oregon) us-west-2 region before proceeding. You can see your current region in the top-right. Using a different region will result in the checks at the end of this lab step failing.

 

2. To open the left-hand menu, click the hamburger icon:

alt

If the menu is already visible, proceed to the next instruction.

 

3. In the left-hand side menu, click Topics:

alt

 

4. Click Create topic:

alt

The Create topic form will open.

 

5. In the Create topic form, under Details, in the Name textbox, enter lab-topic:

alt

A topic in SNS is a communication channel that many services or applications can send and receive messages through.

 

6. Make sure to select the Standard type:

alt

 

6. To create your topic, click Create topic:

alt

Your browser will load a page showing details of your topic and you will see a notification:

alt

 

7. In the Subscriptions section, click Create subscription:

alt

 

8. In the Create subscription form, under Details, select the following values:

  • Topic ARN: value ending with -lab-topic
  • ProtocolEmail

alt

ARN is an acronym for Amazon Resource Name, an ARN is used to uniquely identify a resource in AWS.

 

9. In the Endpoint field, enter your email address:

alt

AWS will send a subscription confirmation email to this email address and you will receive emails about CodeCommit events in later lab steps.

 

10. Click Create subscription:

alt

Your browser will load a page detailing your subscription and you will see a notification:

alt

Creating a subscription in SNS connects a topic to an endpoint, in this case, the endpoint is your email address and you will receive emails when a message is published to the topic.

Possible types of endpoint you can subscribe to a topic include:

  • HTTPS web URL
  • Lambda function
  • Mobile phone

 

12. Check your email for the Subscription Confirmation email and click the Confirm subscription link inside it.

The email you receive will look similar to this:

alt

The email usually takes a minute or two to arrive, it may take up to five minutes.

If you don't see your email please check your spam folder.

 

13. Use your browser to refresh the page in the AWS Management Console.

You will see the status of the subscription has changed from Pending to Confirmed:

alt

 

Summary

In this lab step, you created a topic in SNS and subscribed to the topic using your email address as the endpoint to receive notifications at.

Validation checks
2Checks
Created the SNS Topic

Check that the SNS topic has been created

Amazon Simple Notification Service (SNS)
Subscribed to SNS Topic

Check if the SNS Topic has a confirmed subscription

Amazon Simple Notification Service (SNS)

Learning Pathnavigation