-
Notifications
You must be signed in to change notification settings - Fork 0
/
alarms.tf
59 lines (55 loc) · 1.69 KB
/
alarms.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#CloudWatch Alerts on AMP Usage
resource "aws_cloudwatch_metric_alarm" "active_series_metrics" {
for_each = local.amp_list
alarm_name = "active-series-metrics"
comparison_operator = "GreaterThanOrEqualToThreshold"
evaluation_periods = "2"
threshold = var.active_series_threshold
alarm_description = "This metric monitors AMP active series metrics"
insufficient_data_actions = []
metric_query {
id = "m1"
return_data = true
metric {
metric_name = "ResourceCount"
namespace = "AWS/Usage"
period = "120"
stat = "Average"
unit = "None"
dimensions = {
Type = "Resource"
ResourceId = each.key
Resource = "ActiveSeries"
Service = "Prometheus"
Class = "None"
}
}
}
}
resource "aws_cloudwatch_metric_alarm" "ingestion_rate" {
for_each = local.amp_list
alarm_name = "ingestion_rate"
comparison_operator = "GreaterThanOrEqualToThreshold"
evaluation_periods = "2"
threshold = var.ingestion_rate_threshold
alarm_description = "This metric monitors AMP ingestion rate"
insufficient_data_actions = []
metric_query {
id = "m1"
return_data = true
metric {
metric_name = "ResourceCount"
namespace = "AWS/Usage"
period = "120"
stat = "Average"
unit = "None"
dimensions = {
Type = "Resource"
ResourceId = each.key
Resource = "IngestionRate"
Service = "Prometheus"
Class = "None"
}
}
}
}