An open API service indexing awesome lists of open source software.

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

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.