| « PreviousNext » | |
![]() ![]() ![]() | Did this page help you? Yes | No | Tell us about it... |
This section shows you how to set up an Amazon SNS topic to send an email notification when an alarm changes state. For information about Amazon SNS and instructions on how to create an Amazon SNS email notification, go to the Amazon Simple Notification Service Getting Started Guide.
Note
If you create your Amazon CloudWatch alarm with the AWS Management Console, you can skip this section because you can create an Amazon SNS topic in the Configure Actions step in the Create Alarm Wizard.
To set up an Amazon SNS topic with the AWS Management Console first you create a topic, then you subscribe to it. You can then publish a message directly to the topic to ensure that you have properly configured it.
To create an Amazon SNS topic
Open the Amazon SNS console at https://console.aws.amazon.com/sns/.
If necessary, change the region. From the navigation bar, select the region that meets your needs. For more information, see Regions and Endpoints.

In Getting Started, click Create New Topic.
The Create New Topic dialog box opens.

Enter the topic name MyTopic in the Topic Name field.
Click Create Topic.
The new topic appears in the Topic Details page.

Copy the Topic ARN for the next task.
To subscribe to an Amazon SNS topic
Open the Amazon SNS console at https://console.aws.amazon.com/sns/.
If necessary, change the region. From the navigation bar, select the region that meets your needs. For more information, see Regions and Endpoints.

In the navigation pane, click My Subscriptions in the navigation pane.
The My Subscriptions page opens.
Click Create New Subscription.
The Subscribe dialog box opens.

In the Topic ARN field, paste the topic ARN you created in the previous task, for example: arn:aws:sns:us-east-1:054794666394:MyTopic.
Select Email in the Protocol drop-down list.
Enter an email address you can use to receive the notification in the Endpoint field, and then click Subscribe.
Important
Entourage Users: Entourage strips out the confirmation URL. Please enter an email address you can access in a different email application.
Go to your email application and open the message from AWS Notifications, and then click the link to confirm your subscription.
Your web browser displays a confirmation response from Amazon SNS.
To publish to an Amazon SNS topic
Open the Amazon SNS console at https://console.aws.amazon.com/sns/.
If necessary, change the region. From the navigation bar, select the region that meets your needs. For more information, see Regions and Endpoints.

In the navigation pane, under My Topics, click the topic you want to publish.
The Topic Details page opens.
Click Publish to Topic.
The Publish dialog box opens.

Enter a subject line for your message in the Subject field, and a brief message in the Message field.
Click Publish Message.
A confirmation dialog box opens.
Click Close.
Check your email to confirm that you received the message from the topic.
This scenario walks you through how to use the command line tools to create an Amazon SNS topic, and then publish a message directly to the topic to ensure that you have properly configured it.
Note
This scenario uses the Amazon SNS command line tools. To download the Amazon SNS command line tools, go to http://aws.amazon.com/developertools/3688.
To set up an Amazon SNS topic
Create the topic with the Amazon SNS CLI command sns-create-topic. You receive a topic resource name as a return value:
Prompt>sns-create-topic --name MyTopicAmazon SNS returns the following Topic ARN:
arn:aws:sns:us-east-1:887848922426:MyTopic
Subscribe your email address to the topic with the Amazon SNS CLI command sns-subscribe.
You will receive a confirmation email message if the subscription request succeeds.
Prompt>sns-subscribe --topic arn:aws:sns:us-east-1:887848922426:MyTopic --protocol SMTP --endpoint<your-email-address>
Amazon SNS returns the following:
Subscription request received
Confirm that you intend to receive email from Amazon SNS by clicking the confirmation link in the body of the message to complete the subscription process.
Check the subscription with the Amazon SNS CLI command sns-list-subscription-by-topic.
Prompt>sns-list-subscription-by-topic --topic arn:aws:sns:us-east-1:887848922426:MyTopicAmazon SNS returns the following:
arn:aws:sns:us-east-1:887848922426:MyTopic:97fbacb0-7706-4ee9-9f8c-d56074b25278 SMTP me@my_company.com
Publish a message directly to the topic with the sns-publish command to ensure that the topic is properly configured.
Prompt>sns-publish --message "Verification" --topic arn:aws:sns:us-east-1:887848922426:MyTopicAmazon SNS returns the following:
b94635b4-9cc6-4895-b961-87e9a1ff8ff8
Check your email to confirm that you received the message from the topic.