Skip to content

Integrating AWS Services S3 and CloudWatch Alarms with Slack through lambda functions

Notifications You must be signed in to change notification settings

Rohan-Bierneni/AWSLambda-Slack-Integration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Lambda-Slack-Integration

Two different types of integration with slack.

First part integrates an S3 bucket to slack via lambda function. When file is uploaded to an S3 bucket, invokes a lambda function to post message to Slack channel with url included.

Second part sends a message to Slack channel when CPU Utilization of an EC2 instance goes above threshhold.

Description

S3 Integration:

Creates a new Slack application configured to a specific channel in a workspace. Activate incoming webhooks to allow POST message from external sources (AWS Lambda in this case). In AWS Console, create a lambda function with Python 3.9 and a role that has permissions to CloudWatch logs and S3 (read & write). The policy used in the role is AWSLambdaExecute. In the function code, use urllib3 to send the POST request to the slack channel.

CloudWatch Alarms Integration

The CloudWatch Alarm pushes an SNS notification that invokes a lambda function as well as pushes message to email. The lambda function takes the json data from SNS and reformats to a structured message and POSTS to the Slack channel via incoming webhooks.

Visuals

Screen Shot 2022-03-31 at 4 31 19 PM

Screen Shot 2022-03-31 at 4 33 01 PM

About

Integrating AWS Services S3 and CloudWatch Alarms with Slack through lambda functions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages