logs2sns is CloudFormation template for Lambda function that notify event with email using CloudWatchLogs subscription filter.
Login to AWS management console and create CloudFormation stack with logs2sns.yml(logs2sns2.yml). See: http://dev.classmethod.jp/cloud/aws/notify-error-cloudwatch-logs-with-lambda/
Standard logs2sns has one FilterPattern and one SNS Topic.
- FilterPattern: Log pattern to notify
- FilterPatternExcluded: Log exclude pattern to notify
- MailSubject: Subject of notify mail ー NotifyTopicNameWarning: SNS topic name for notify.
2way logs2sns has two set of FilterPattern and one SNS Topic. One is warning filter and other is error filter.
- ErrorFilterPattern: Error log pattern to notify
- ErrorFilterPatternExcluded: Error log exclude pattern to notify
- ErrorMailSubject: Subject of error notify mail ー ErrorNotifyTopicName: SNS topic name for error notify.
- WarningFilterPattern: Warning log pattern to notify
- WarningFilterPatternExcluded: Warning log exclude pattern to notify
- WarningMailSubject: Subject of warning notify mail ー WarningNotifyTopicName: SNS topic name for warning notify.
- Create SNS Topic with email subscription.
- Create IAM Role for Lambda function.
- Create Lambda function process CloudWatch Logs streaming event (filter and notify email).
- Add permission to Lambda function to invoke from CloudWatch Logs
- The MIT License (MIT)