Cloudwatch alerts on slack.
Usually glueing Cloudwatch alerts to Slack requires a Lambda function, requires you to know how to parse the SNS, and specify a channel.
This projects creates a lambda function that knows how to send cloudwatch-alert-SNSs to Slack. You can use this project to handle alerts for multiple projects.
- do
serverless install -u https://github.com/dav009/serverless-aws-alarms-notifier
- Go to AWS ec2's parameter store and add a new parameter containing your slack token
- Edit
serverless.yml
replacingparameter_name_where_slack_token_is_store
for the parameter name on ec2 parameter store - Deploy
- run sh bootstrap.sh (just neded the first time..)
- run sls deploy
- Use the SNS generated by this project when creating your Cloudwatch alerts (
cloudwatch-alerts-sns
).- When creating your Cloudwatch alarm add
channel:XX
to the alarm description, replaceXX
with a slack channel
- When creating your Cloudwatch alarm add
Note: make sure the role of the generated lambda function has access to sms:xx
and to the KMS key you used to encrypt your parameter.