|
| 1 | +{ |
| 2 | + "title": "Account level alerting using Amazon CloudWatch, AWS Lambda and Amazon SNS", |
| 3 | + "description": "Creates alerting system at account level which triggers Lambda function which can parse and publish a SNS notification", |
| 4 | + "language": "Python", |
| 5 | + "level": "200", |
| 6 | + "framework": "SAM", |
| 7 | + "introBox": { |
| 8 | + "headline": "How it works", |
| 9 | + "text": [ |
| 10 | + "This sample project showcases a centralized alerting system that leverages CloudWatch Logs Subscription filters and Lambda functions to trigger SNS notifications when a specified pattern is matched across any CloudWatch log group within the account. This robust solution enables comprehensive monitoring and proactive alerting, ensuring timely identification and mitigation of critical events or errors", |
| 11 | + "The core components of this pattern include a CloudWatch Logs Account-level Subscription filter, which monitors log events across the entire account, and a notification Lambda function. This function is triggered by the Subscription filter and responsibly publishes relevant details, such as log group name, log stream name, and the matched log event, to the SNS topic, ensuring that stakeholders receive comprehensive and actionable information." |
| 12 | + ] |
| 13 | + }, |
| 14 | + "gitHub": { |
| 15 | + "template": { |
| 16 | + "repoURL": "https://github.com/aws-samples/serverless-patterns/tree/main/cloudwatch-account-subscription-Lambda-sns-notification", |
| 17 | + "templateURL": "serverless-patterns/cloudwatch-account-subscription-Lambda-sns-notification", |
| 18 | + "projectFolder": "cloudwatch-account-subscription-Lambda-sns-notification", |
| 19 | + "templateFile": "template.yaml" |
| 20 | + } |
| 21 | + }, |
| 22 | + "resources": { |
| 23 | + "bullets": [ |
| 24 | + { |
| 25 | + "text": "Account-level subscription filters", |
| 26 | + "link": "https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/SubscriptionFilters-AccountLevel.html#LambdaFunctionExample-AccountLevel" |
| 27 | + }, |
| 28 | + { |
| 29 | + "text": "Lambda function", |
| 30 | + "link": "https://docs.aws.amazon.com/lambda/latest/dg/welcome.html" |
| 31 | + } |
| 32 | + ] |
| 33 | + }, |
| 34 | + "deploy": { |
| 35 | + "text": [ |
| 36 | + "sam build", |
| 37 | + "sam deploy --guided --parameter-overrides EmailAddress='[email protected]' LambdaFunctionName='NotificationLambda'" |
| 38 | + ] |
| 39 | + }, |
| 40 | + "testing": { |
| 41 | + "text": [ |
| 42 | + "To test this pattern, which monitors all log groups for the 'Exception' pattern and sends SNS notifications, follow these steps:", |
| 43 | + "1. Choose an application generating logs in your AWS account.", |
| 44 | + "2. Intentionally introduce an exception or error condition that logs an 'Exception' message.", |
| 45 | + "3. Verify the log event containing 'Exception' is written to CloudWatch Logs.", |
| 46 | + "4. Monitor for an SNS email notification containing details like the log group name, log stream name, and the log event with the 'Exception' pattern.", |
| 47 | + "This pattern automatically monitors new log groups created, ensuring comprehensive coverage across your AWS account." |
| 48 | + ] |
| 49 | + }, |
| 50 | + "cleanup": { |
| 51 | + "text": [ |
| 52 | + "Delete the stack: <code>cdk delete</code>." |
| 53 | + ] |
| 54 | + }, |
| 55 | + "authors": [ |
| 56 | + { |
| 57 | + "name": "Shubham", |
| 58 | + "image": "https://avatars.githubusercontent.com/u/150242047?s=400&u=aaa2db07529d3e1e82ec59daacb05b6abc7c3a5f&v=4", |
| 59 | + "bio": "Cloud Support Engineer - SVLS", |
| 60 | + "linkedin": "shubham-more-1b6aa185" |
| 61 | + } |
| 62 | + ], |
| 63 | + "patternArch": { |
| 64 | + "icon1": { |
| 65 | + "x": 20, |
| 66 | + "y": 50, |
| 67 | + "service": "cloudwatch", |
| 68 | + "label": "Amazon CloudWatch" |
| 69 | + }, |
| 70 | + "icon2": { |
| 71 | + "x": 50, |
| 72 | + "y": 50, |
| 73 | + "service": "lambda", |
| 74 | + "label": "AWS Lambda" |
| 75 | + }, |
| 76 | + "line1": { |
| 77 | + "from": "icon1", |
| 78 | + "to": "icon2", |
| 79 | + "label": "trigger" |
| 80 | + }, |
| 81 | + "icon3": { |
| 82 | + "x": 80, |
| 83 | + "y": 50, |
| 84 | + "service": "sns", |
| 85 | + "label": "Amazon SNS" |
| 86 | + }, |
| 87 | + "line2": { |
| 88 | + "from": "icon2", |
| 89 | + "to": "icon3", |
| 90 | + "label": "publish" |
| 91 | + } |
| 92 | + } |
| 93 | +} |
0 commit comments