-
Notifications
You must be signed in to change notification settings - Fork 5
/
hosts.tf
30 lines (26 loc) · 1.17 KB
/
hosts.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
locals {
hosts_filter = var.hosts_filter_override != "" ? var.hosts_filter_override : var.filter_str
hosts_notification_channel = var.hosts_alerting_enabled ? var.notification_channel : ""
}
module "hosts" {
source = "kabisa/generic-monitor/datadog"
version = "1.0.0"
name = "Estimated Hosts Usage"
query = "avg(${var.hosts_evaluation_period}):sum:datadog.estimated_usage.hosts{${local.hosts_filter}} > ${var.hosts_critical}"
alert_message = "The Plan specified {{threshold}} Hosts. The current estimate ({{value}}) exceeds the plan"
recovery_message = "Count of Monitored Hosts has recovered"
# monitor level vars
enabled = var.hosts_enabled
alerting_enabled = var.hosts_alerting_enabled
critical_threshold = var.hosts_critical
warning_threshold = var.hosts_warning
priority = var.hosts_priority
docs = var.hosts_docs
note = var.hosts_note
# module level vars
env = var.env
service = var.service
notification_channel = var.notification_channel
additional_tags = var.additional_tags
locked = var.locked
}