109 lines
3.4 KiB
HCL
109 lines
3.4 KiB
HCL
terraform {
|
|
required_providers {
|
|
dynatrace = {
|
|
version = "1.10.0"
|
|
source = "dynatrace-oss/dynatrace"
|
|
}
|
|
}
|
|
}
|
|
resource dynatrace_alerting_profile main {
|
|
|
|
display_name = "${var.alertingProfileName}"
|
|
mz_id = "${var.mzId}"
|
|
|
|
rules {
|
|
delay_in_minutes = "${var.delay_AVAILABILITY}"
|
|
severity_level = "AVAILABILITY"
|
|
tag_filter {
|
|
include_mode = "${var.include_mode}"
|
|
dynamic "tag_filters" {
|
|
for_each = var.include_mode != "NONE" ? var.tag_filters : []
|
|
content {
|
|
context = tag_filters.value["context"]
|
|
key = tag_filters.value["key"]
|
|
value = tag_filters.value["value"]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
rules {
|
|
delay_in_minutes = "${var.delay_CUSTOM_ALERT}"
|
|
severity_level = "CUSTOM_ALERT"
|
|
tag_filter {
|
|
include_mode = "${var.include_mode}"
|
|
dynamic "tag_filters" {
|
|
for_each = var.include_mode != "NONE" ? var.tag_filters : []
|
|
content {
|
|
context = tag_filters.value["context"]
|
|
key = tag_filters.value["key"]
|
|
value = tag_filters.value["value"]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
rules {
|
|
delay_in_minutes = "${var.delay_ERROR}"
|
|
severity_level = "ERROR"
|
|
tag_filter {
|
|
include_mode = "${var.include_mode}"
|
|
dynamic "tag_filters" {
|
|
for_each = var.include_mode != "NONE" ? var.tag_filters : []
|
|
content {
|
|
context = tag_filters.value["context"]
|
|
key = tag_filters.value["key"]
|
|
value = tag_filters.value["value"]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
rules {
|
|
delay_in_minutes = "${var.delay_MONITORING_UNAVAILABLE}"
|
|
severity_level = "MONITORING_UNAVAILABLE"
|
|
tag_filter {
|
|
include_mode = "${var.include_mode}"
|
|
dynamic "tag_filters" {
|
|
for_each = var.include_mode != "NONE" ? var.tag_filters : []
|
|
content {
|
|
context = tag_filters.value["context"]
|
|
key = tag_filters.value["key"]
|
|
value = tag_filters.value["value"]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
rules {
|
|
delay_in_minutes = "${var.delay_PERFORMANCE}"
|
|
severity_level = "PERFORMANCE"
|
|
tag_filter {
|
|
include_mode = "${var.include_mode}"
|
|
dynamic "tag_filters" {
|
|
for_each = var.include_mode != "NONE" ? var.tag_filters : []
|
|
content {
|
|
context = tag_filters.value["context"]
|
|
key = tag_filters.value["key"]
|
|
value = tag_filters.value["value"]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
rules {
|
|
delay_in_minutes = "${var.delay_RESOURCE_CONTENTION}"
|
|
severity_level = "RESOURCE_CONTENTION"
|
|
tag_filter {
|
|
include_mode = "${var.include_mode}"
|
|
dynamic "tag_filters" {
|
|
for_each = var.include_mode != "NONE" ? var.tag_filters : []
|
|
content {
|
|
context = tag_filters.value["context"]
|
|
key = tag_filters.value["key"]
|
|
value = tag_filters.value["value"]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
} |