Repository navigation
The purpose of this telegram-bot:v0.3.0 release is to deliver human-friendly notifications for "CloudWatch alarm state change" events not only to Telegram, but to all Amazon SNS subscribers such as email and SMS recipients or even other lambdas delivering IM notificaitons on other platforms. SNS subscribers are upstream of this lambda, so this necessitated splitting out the code from the previous release that parses the Message string into a separate lambda, aws-cloudwatch-alarm-handler. This release contains breaking changes and warrants a major version bump, but it is not a v1 because it is still missing test coverage.
Breaking Changes
- Notification formatting was outsourced to the aws-cloudwatch-alarm-handler lambda.
- The SNS
Messagestring is now delivered to Telegram verbatim, no parsing is done. - The lambda handler was changed from
handler.entrypointtoindex.handlerto be consistent with AWS Lambda defaults.- The main JavaScript file was renamed from
handler.jstoindex.js. - The entrypoint function was changed from
entrypoint()tohandler().
- The main JavaScript file was renamed from
- Some environment variables have changed.
TIMEZONEwas removed, as this is only used for message formatting.DEV_EVENT_SOURCE_ARNwas renamed toTEST_EVENT_SOURCE_ARN, and is now being fully parsed instead of the previous lazy matching.
- The return value schema has changed.
Other Changes
- User-defined string replacements can now be performed on the Telegram message contents and the log output.
- Very limited markdown interpolation is performed on the input string and is converted to HTML.
>> Full Diff <<
Architecture
The general idea is this:
CloudWatch => EventBridge => SNS topic 1 => CloudWatch formatting lambda (aws-cloudwatch-alarm-handler) => SNS topic 2 =>
Telegram notification lambda (telegram-bot), SMS, email
This simplifies a lot of the code, making this system both more flexible and more resilient.