This module creates a CloudWatch alarm that triggers when a log group is not receiving the expected amount of
data based on the IncomingLogEvents
metric. The input is a list of log group names ex. ["/aws/lambda/
my-lambda", "/aws/lambda/my-other-lambda"] as well as the arn of a SNS topic to send the alarm to. The module
also incudes the flag use_anomaly_detection
which will use anomaly detection feature to determine the expected
amount of data, otherwise it will alert on log groups that receive 0 IncomingLogEvents
over the time period.
Note: AWS anomaly detection works best in very specific, unclear, circumstances.
Example usage:
module "empty_log_group_alarm" {
source = "github.com/cds-snc/terraform-modules/empty_log_group_alarm"
alarm_sns_topic_arn = "arn:aws:sns:ca-central-1:000000000000:alert"
log_group_names = ["/aws/lambda/foo"]
billing_tag_value = "TagValue"
}
No requirements.
Name | Version |
---|---|
aws | n/a |
No modules.
Name | Type |
---|---|
aws_cloudwatch_metric_alarm.empty_log_group_metric_alarm | resource |
aws_cloudwatch_metric_alarm.empty_log_group_metric_alarm_using_anomaly_detection | resource |
Name | Description | Type | Default | Required |
---|---|---|---|---|
alarm_sns_topic_arn | (Required) The ARN to send the alarm to | string |
n/a | yes |
billing_tag_key | (Optional, default 'CostCentre') The name of the billing tag | string |
"CostCentre" |
no |
billing_tag_value | (Required) The value of the billing tag | string |
n/a | yes |
log_group_names | (Required) The list of log group names to monitor | list(string) |
[] |
no |
time_period_minutes | (Optional, default 5) The time period in minutes to check for incoming logs | number |
5 |
no |
use_anomaly_detection | n/a | bool |
false |
no |
No outputs.