Giter Club home page Giter Club logo

aws-cloudwatch-alarms-to-microsoft-teams-forwarder's Introduction

AWS CloudWatch Alarms To Microsoft Teams Forwarder

This project contains an AWS Lambda function (ES6) that posts messages to a Microsoft Teams Webhook. With it, a team can receive AWS CloudWatch Alarms in a Microsoft Teams channel. Alarm data is preserved as is, but formatted in an HTML table

The function is designed to be attached as a subscriber to one or more SNS topics, which again is notified from CloudWatch Alarms.

This readme contains the following sections:

All commands below assume a POSIX compliant shell.

Development guide

Firstly:

npm install

Then, with AWS SAM CLI ๐Ÿฟ, post a message to your Microsoft Teams channel like this:

cat sample-event.json | sam local invoke AwsCloudWatchAlarmsToMsTeamsForwarder

File sample-event.json contains a dummy CloudWatch Alert event. The lambda function forwards this alert to the Microsoft Teams channel specified by the Webhook URL in template.yaml.

Deployment guide

The following steps describe how to install the lambda on AWS. You will need npm, aws cli and sam cli before you proceed. Also, from your terminal, ensure that you have configured proper AWS credentials.

Build the lambda project

npm install

Create the lambda S3 bucket

aws s3 mb s3://BUCKET_NAME

Where BUCKET_NAME is the name of the bucket you want to use for storing the packaged lambda function.

Build the lambda package

sam package --template-file template.yaml --s3-bucket BUCKET_NAME --output-template-file packaged.yaml

Deploy the lambda package

sam deploy --template-file ./packaged.yaml --stack-name LAMBDA_STACK_NAME --capabilities CAPABILITY_IAM

where LAMBDA_STACK_NAME is the AWS CloudFormation script name that you want to use.

Manual step - Configure the lambda function

From the AWS console, open the settings for your lambda function.

Update environment variable TEAMS_WEB_HOOK_URL to point to the relevant Microsoft Teams Webhook.

Manual step - attach to SNS topic

Attach the lambda function as an SNS subscriber to the SNS topic associated with your CloudWatch alarms.

aws-cloudwatch-alarms-to-microsoft-teams-forwarder's People

Contributors

dependabot[bot] avatar moelholm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.