DevelopmentJanuary 1, 2026

How to send AWS CloudWatch alarms to Slack

Alarm and monitoring systems are a key piece of any mature product or application. If you care about your customers, it's better to find out when something breaks than to be left in the dark. If your infrastructure is on AWS, the only way to get all the metrics for the services you use is CloudWatch. But AWS CloudWatch doesn't just give you access to metrics: it also lets you create alarms for specific cases. That said, if you've worked with AWS before, you've surely noticed that its interface and some features are far from "user friendly," so sending alarm notifications to Slack isn't exactly trivial.

In this article I'll walk you through the tricks you need to know to set up the alarms you need in five minutes, step by step and with a screenshot of every screen.

Here are the steps we're going to follow:

  • Create an AWS Access Key and Secret
  • Create a role
  • Deploy the Lambda function
  • Create an SNS topic and a subscription
  • Create a CloudWatch alarm

1. Create an AWS Access Key and Secret

If you already have your AWS Access Key and Secret, you can skip this step. If not, go to this link. Select your user, go to the Security Credentials tab, and click Create Access Key.

Copy the AWS Access Key and Secret; we'll use them when configuring the Lambda function deployment.

2. Create a role

The Lambda function will use this role, which needs permissions to do certain things. Go to this link and click Create Role.

Select Lambda from the list.

Search for AWSLambdaBasicExecutionRole and select it.

Finally, type a name for the role, for example "cloudwatch-to-slack-role," click on the newly created role in the list, and copy its ARN. We'll use it in step 3, when deploying the Lambda function.

3. Deploy the Lambda function

To deploy the AWS Lambda function you need to clone the repository and have Node.js installed on your machine. The repository includes a setup process that makes this step much simpler.


git clone git@github.com:assertible/lambda-cloudwatch-slack.git
cd lambda-cloudwatch-slack
cp .env.example .env

Open the .env file and fill in the environment variables.

UNENCRYPTED_HOOK_URL This variable holds the Slack Incoming Webhook. Create a new one for CloudWatch on this page for your organization.

Follow the good practice of using a separate webhook for each specific service. When you create the webhook, choose the channel where notifications will be posted, set a username (the title of the messages), and, of course, add a nice image. You can download the CloudWatch logo here.

AWS_FUNCTION_NAME The name of your function, which will appear on the AWS Lambda page. Let's call it "cloudwatch-to-slack."

AWS_REGION=eu-west-1 Choose the region for the Lambda function.

AWS_ROLE=”arn:aws:iam::123456789123:role/lambda_exec_role” Paste the ARN from step 2 here.

AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY Fill these in with the AWS Access Key and Secret from step 1.

Now everything is ready to deploy. Just run this command in the terminal, from the folder of the repository we cloned:


npm install
npm run deploy

If everything went well, you'll see the newly installed function on the AWS Lambda page.

4. Create an SNS topic and a subscription

Go to Simple Notification Service in AWS. Ironically, this service is anything but simple, mostly because of the terminology it uses and the steps involved.

Go to Topics and click Create New Topic. I chose the name "cloudwatch-alarms" for the notifications that will be sent.

Open the topic you just created and create a subscription.

Select AWS Lambda as the protocol and choose the endpoint with your function's name.

And that's it: now we can create an alarm.

5. Create a CloudWatch alarm

Go to CloudWatch from your AWS account and click Create Alarm.

Choose the metric you want to monitor, set up the alarm configuration, and select the name of your SNS topic in the Send Notification To section.

I recommend deliberately setting conditions that trigger the alarm right away to test the function. If everything is configured correctly, you'll see the message in your Slack channel.

I hope this guide helps you save time and set up the alarms for your current or future projects.

Additional notes: AWS Lambda includes built-in blueprints by default that let you do various things with a simple configuration, and among them you can even find a CloudWatch-to-Slack function. Unfortunately, it sends very poor, unstructured data to the channel.

Tell us about your case

Get in touch