cloudwatch-to-google-chat
cloudwatch-to-google-chat copied to clipboard
An AWS serverless function (lambda) written in Go, that takes Cloudwatch Alarms from SNS and publish them to Google Chat (using a Google Chat webhook)
Cloudwatch Alarms in Google Chat
This is an AWS Lambda function written in Go that receives alarms from AWS Cloudwatch and publishes them to a Google Chat chat room.
Service-In-AWS --> Cloudwatch Alarms --> SNS --> This-Lambda --> Google Chat
Deployment using AWS SAM
Deployment uses the AWS Serverless Application Model, with the template and config provided.
Prerequisites
You'll need:
-
go
installed (version 1.16 or newer) - AWS SAM CLI installed
- AWS CLI credentials set-up
Deploying to AWS
The deploy.sh
script was tested on MacOS, and should work on Linux. You may need to adjust it if you are using Windows.
- Create an SNS Topic and configure your Cloudwatch Alarms to send notifications to it (if you have not already done so).
- Create a webhook in Google Chat.
- Execute
./aws-serverless/deploy.sh -g
- Enter parameter values when prompted:
-
ChatWebhookUrl
The Google Chat webhook URL. -
AlertImageUrl
The URL of an image to show at the top of ALARM notification messages (optional; e.g. the exclamation triangle in the screenshot below). -
OkImageUrl
The URL of an image to show at the top of OK notification messages (optional; e.g. the tick-mark in the screenshot below) -
SnsArn
The ARN of the existing SNS Topic. - Use the default values for the other parameters.