$ show terraform-aws-modules/terraform-aws-notify-slack
This Terraform module provisions an AWS SNS topic and a Lambda function (Python 3.13) that forwards SNS notifications to a Slack channel via webhook. The Lambda function parses and formats various AWS event typesβCloudWatch alarms, GuardDuty findings, Security Hub findings, AWS Health events, AWS Backup notifications, and generic messagesβinto structured Slack attachments. It supports encrypted webhook URLs via KMS, custom Lambda functions, VPC configuration, and SNS subscription filtering. The module is part of the terraform-aws-modules ecosystem and follows standard Terraform module conventions with comprehensive CI/CD, pre-commit hooks, and semantic release. The Python code includes unit tests with snapshot testing, linting, and type checking, demonstrating solid engineering practices.
The LLM identified 1 files worth highlighting for reuse:
The core Lambda function that receives SNS events, parses them, and formats Slack messages. It uses a modular design with separate formatting functions for each AWS event type (CloudWatch, GuardDuty, Security Hub, Health, Backup) and enums for severity-to-color mapping. The code is self-contained (only depends on standard library and boto3) and could be extracted into a reusable library for AWS-to-Slack notification formatting. It demonstrates good separation of concerns and handles edge cases like encrypted URLs and GovCloud regions.