This repository has been archived by the owner on Sep 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: solve issues with CW Alarm URLs, add development stack, update t…
…o node 20 (#312)
- Loading branch information
1 parent
478de17
commit 03311b6
Showing
15 changed files
with
2,294 additions
and
5,708 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,7 @@ dist | |
.aws-sam | ||
samconfig.toml | ||
sonar-report.xml | ||
.idea | ||
.idea | ||
.cdk.staging | ||
cdk.out | ||
cdk.context.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Development and debugging setup for cloudwatch-alarm-to-ms-teams | ||
|
||
This folder contains a small CDK stack that deploys the application's lambda function directly from source and connects a test alarm to it. | ||
Useful for debugging or when working on the layout of the adaptive cards. | ||
|
||
> [!CAUTION] | ||
> | ||
> USE AT YOUR OWN RISK! | ||
> Using this stack will incur cost. Created and used AWS resources are a lambda function, an associated IAM role | ||
> a sns topic, a cloudwatch alarm and a CloudWatch LogGroup | ||
> HTTPS calls to the provided webhook URL will be made! | ||
> | ||
> The setup uses minimal configuration. Never deploy to an AWS account with production workloads! | ||
# Prerequisites | ||
|
||
- Access to an AWS account with required permissions | ||
- The account needs to be [bootstrapped for CDK](https://docs.aws.amazon.com/cdk/v2/guide/bootstrapping.html). | ||
- if it isn't, run `npx cdk bootstrap aws://ACCOUNT-NUMBER/REGION` with proper permissions to achieve that | ||
- node.js >=20 installed | ||
- A Webhook URL for Microsoft Teams | ||
|
||
# Usage | ||
|
||
- Run `npm install` in this folder | ||
- Deploy providing your webhook url by running `npm run cdk-deploy -- -c webhook-url=https://your-webhook-url` | ||
- Later clean up by running `npm run cdk-destroy` (or delete the stack `CloudWatchAlarmToMsTeamsDevelopment` in CloudFormation) | ||
|
||
# What it does | ||
|
||
- The cloudwatch-alarm-to-ms-teams [lambda function](../src/handlers) will be packaged and deployed directly from source | ||
- it will be parameterized with the provided webhook URL | ||
- A flickering CloudWatch alarm (switching between alarm and OK state every ~ 5 minutes, can be sped up by modifying the alarm config) will be created that triggers the lambda via SNS | ||
- If everything works, you'll get an adaptive card send to your Webhook URL almost immediately after deployment. | ||
- perform code changes and redeploy as required, you'll keep getting fast feedback directly to your Webhook URL | ||
|
Oops, something went wrong.