Creating a set of generic SNS Topics

When I’m creating a new AWS account, I find it helpful to have a generic set of SNS topics that ping me and my team if something goes wrong.

The following CloudFormation template can be used for that purpose. It requires a few parameters and includes an optional Lambda that will send the alerts to a Slack Channel.

Three Topics are created for critical, error and info-level alerts. Critical alerts will send me a text and email, while error only sends an email. Info alerts typically only go to slack (or a filtered email folder).

A generic Spending Alarm is also created by the Template.

The SlackNotification Lambda is small enough to be included in-line. The Webhook URL, AccountDescription, Slack Channel and IconEmoji are template parameters that are passed to the function via Lambda Environment Variables.

The stack will output the ARN for the three Topics so they can be referenced in other places, and I’m using Stack Exports so you don’t need to use deploy_stack trickery to find them.