Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/timlrx/aws-notification-lambda
Simple Lambda function to send notification to Discord or Slack. Can be used standalone or as an SNS subscriber.
https://github.com/timlrx/aws-notification-lambda
aws-lambda discord lambda slack sns webhook
Last synced: 14 days ago
JSON representation
Simple Lambda function to send notification to Discord or Slack. Can be used standalone or as an SNS subscriber.
- Host: GitHub
- URL: https://github.com/timlrx/aws-notification-lambda
- Owner: timlrx
- License: mit
- Created: 2022-06-30T08:20:07.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-09-08T06:58:03.000Z (about 2 years ago)
- Last Synced: 2024-10-04T19:44:32.725Z (about 1 month ago)
- Topics: aws-lambda, discord, lambda, slack, sns, webhook
- Language: JavaScript
- Homepage:
- Size: 30.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AWS Notification Lambda
A simple lambda function to send a notification to Discord or Slack. Also works with SNS, in which case `webhookUrl` and `statusCode` would be MessageAttributes.
## Discord
![discord-notification](./sample-discord.png)
### Deploy
```
create_function.sh notify_discord
```### Update
```
update_function.sh notify_discord
```### Usage
1. Generate a [basic execution lambda role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html) and set the `ROLE_ARN` environment variable to it.
2. Generate a [Discord webhook URL](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks). Payload `webhookUrl` should correspond to the webhook URL to post the message to the right channel.
3. Assuming you have aws config and credentials set up, run `bash create_function.sh notify_discord` to deploy the function.
4. You can send a payload with 3 fields (`statusCode`, `title`, `body`) - If `statusCode` (optional) is not 200, a red colored message is sent with a warning sign.## Slack
![slack-notification](./sample-slack.png)
### Deploy
```
create_function.sh notify_slack
```### Update
```
update_function.sh notify_slack
```### Usage
1. Generate a [basic execution lambda role](https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html) and set the `ROLE_ARN` environment variable to it.
2. Generate a [Slack webhook URL](https://api.slack.com/messaging/webhooks). Payload `webhookUrl` should correspond to the webhook URL to post the message to the right channel.
3. Assuming you have aws config and credentials set up, run `bash create_function.sh notify_discord` to deploy the function.
4. You can send a payload with 3 fields (`statusCode`, `title`, `body`) - If `statusCode` (optional) is not 200, a red colored message is sent with a warning sign. `body` accepts markdown.