https://github.com/nabeken/aws-chatbot-mention
A Lambda function that inserts an additional mention to SNS message sent to AWS Chatbot
https://github.com/nabeken/aws-chatbot-mention
aws chatbot sns
Last synced: 2 months ago
JSON representation
A Lambda function that inserts an additional mention to SNS message sent to AWS Chatbot
- Host: GitHub
- URL: https://github.com/nabeken/aws-chatbot-mention
- Owner: nabeken
- License: mit
- Created: 2021-06-09T12:53:55.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-08-21T03:11:11.000Z (almost 5 years ago)
- Last Synced: 2025-06-23T06:36:41.617Z (about 1 year ago)
- Topics: aws, chatbot, sns
- Language: Go
- Homepage:
- Size: 13.7 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# aws-chatbot-mention
`aws-chatbot-mention` allows to insert an additional mention for notifications sent to AWS Chatbot.
## How it works
`aws-chatbot-mention` is a lambda function that sits between AWS Chatbot and its SNS topic.
```
[CloudWatch] -> [SNS] -> [aws-chatbot-mention] -> [SNS] -> [AWS Chatbot]
```
To insert an additional mention to the message, `aws-chatbot-mention` will detect a notification type and alter the SNS message.
**CloudWatch Alarm**: When `aws-chatbot-mention` finds special keyboards in the Alarm Description, it will copy text to `NewStateReason` so that Chatbot will show the text in the notification.
Example:
```
mention-OK:
mention-ALARM:
```
If `NewStateValue` is `ALARM`, it will copy the text after `mention-ALARM:` string to the Alarm Description. If the state is `OK`, then it will copy the text after `mention-OK:`.
**CloudWatch Events**: `aws-chatbot-mention` will check a tag named `SLACK_GROUP` in the SNS topic. If a value exists, it will decode it by base64 and inject it into the text in the notification. The available characters in a tag is very restrictive so we decided to encoded a value in base64.