API Usage – SNS

Creating a SNS topic is important as this function bridges the alert system (CloudWatch) with the function which calls our API (Lambda).

To create a SNS topic, within the AWS console select 'SNS' and from that applications' dashboard select 'Create Topic'.  Give the new topic an easy remember name, which you can associate with this application, for example, "push-alert-to-cloudMonitor".

Once you've created the SNS topic, you need to subscribe something to it.  On the screen which you should see after creating a new topic, select "AWS Lambda" for "Protocol", which should then populate a selection list of Lambda functions.  Select the function you've just created so that the topic, when triggered, calls the Lambda function, passing along data passed into the topic.

Once you click "Create Subscription", your SNS topic is ready to distribute alarms to our API.  All you need to do now is to configure CloudWatch to send alerts there.