In this post we’ll be setting up Amazon Simple Notification System (SNS) to enable it to email me in response to an alarm I’m going to be setting up. SNS uses two principles to operate:

  • Topics, which is what messages are about
  • Subscriptions, which is where the messages are going and how they will be sent

So a topic might be a report failure, and the subscriptions associated with the topic might be the report owner’s email address, the Service Desk website and the Out Of Hours mobile number.

Let’s get started! The first step will be to switch regions to N. Virginia (US-East-1). This is because the SNS I’m setting up here will be used for a billing alert we’ll be setting up next time, and the billing data is only available in N. Virginia. When setting up an SNS topic it must be created in the same region as the resource using it - in this case that’s the billing data although it could just as easily be an EC2 instance, CloudWatch alarm etc.

Once that’s done, search for SNS in the console.

AWSB0007-01_SNSConsole

The Amazon SNS dashboard will load. This screen shows all current topics and subscriptions, but as I want to create a new one I’ll load the Amazon SNS main page:

AWSB0007-02_SNSMain

From here a new topic can be created, starting with the name:

AWSB0007-03_SNSTopicCreate

In my example I’m using Provider_Account_Region_Function_Service. We then move to the Create Topic screen where many features (all optional) are presented. I won’t be using any of them for now, although I will apply some tags:

AWSB0007-04_SNSTopicTags

The next step is to create a subscription for the topic. There are several ways to do this - here I’ll navigate to Subscriptions and click the Create Subscription button

AWSB0007-05_SNSSubscription

I am asked to specify a protocol. This is how SNS will deliver messages, and there’s lots to choose from:

AWSB0007-06_SNSSubscriptionList

I’ll select Email, and am prompted for an email address. AWS will not send anything to this email address until it is confirmed - in the case of email this involves an email automatically being sent to the address specified:

AWSB0007-07_SNSEmailReq

Until this process is complete, the subscription status will show as Pending Confirmation:

AWSB0007-08_SNSSubPend

When the owner of the email account clicks the Confirm Subscription link they are informed that their subscription is confirmed:

AWSB0007-09_SNSEmailConf

And the subscription status changes to Confirmed

AWSB0007-10_SNSSubConf

All done! Next time we’ll be using our new SNS topic to set up some billing alerts.

Thanks for reading ~~^~~