From 3497c00cde75af7cf46b4149b9e0cdeabd7739f0 Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 19:11:42 +0100 Subject: [PATCH] "Migrating from Monaco to Terraform for management zone: CD_CoCo-Health-Monitor" --- .../alerting/cd_coco-health-monitor_prod.tf | 38 +++++++++++++++++++ .../management_zone/cd_coco-health-monitor.tf | 20 ++++++++++ 2 files changed, 58 insertions(+) create mode 100644 NA_PROD/alerting/cd_coco-health-monitor_prod.tf create mode 100644 NA_PROD/management_zone/cd_coco-health-monitor.tf diff --git a/NA_PROD/alerting/cd_coco-health-monitor_prod.tf b/NA_PROD/alerting/cd_coco-health-monitor_prod.tf new file mode 100644 index 00000000..ddf2769d --- /dev/null +++ b/NA_PROD/alerting/cd_coco-health-monitor_prod.tf @@ -0,0 +1,38 @@ +# DEFINE dynatrace_alerting.CD_CoCo-Health-Monitor_PROD.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACQwMGNjZTY0Ni1lYzdmLTMxNTgtODgwZC1mMDIzODNlZDdhZTe-71TeFdrerQ +data "dynatrace_management_zone" "CD_CoCo-Health-Monitor_PROD"{ name="CD_CoCo-Health-Monitor" } +resource "dynatrace_alerting" "CD_CoCo-Health-Monitor_PROD" { + name = "CD_CoCo-Health-Monitor PROD" + management_zone = data.dynatrace_management_zone.CD_CoCo-Health-Monitor_PROD.id + rules { + rule { + delay_in_minutes = 0 + include_mode = "INCLUDE_ALL" + severity_level = "AVAILABILITY" + tags = [ "Environment:PROD" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "CUSTOM_ALERT" + tags = [ "Environment:PROD" ] + } + rule { + delay_in_minutes = 10 + include_mode = "INCLUDE_ALL" + severity_level = "ERRORS" + tags = [ "Environment:PROD" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "PERFORMANCE" + tags = [ "Environment:PROD" ] + } + rule { + delay_in_minutes = 30 + include_mode = "INCLUDE_ALL" + severity_level = "RESOURCE_CONTENTION" + tags = [ "Environment:PROD" ] + } + } +} \ No newline at end of file diff --git a/NA_PROD/management_zone/cd_coco-health-monitor.tf b/NA_PROD/management_zone/cd_coco-health-monitor.tf new file mode 100644 index 00000000..b67cd3c0 --- /dev/null +++ b/NA_PROD/management_zone/cd_coco-health-monitor.tf @@ -0,0 +1,20 @@ +# DEFINE dynatrace_management_zone.CD_CoCo-Health-Monitor.id = 8268855926904405674 +resource "dynatrace_management_zone" "CD_CoCo-Health-Monitor" { + name = "CD_CoCo-Health-Monitor" + entity_selector_based_rule { + enabled = true + selector = "type(PROCESS_GROUP_INSTANCE),tag(\"compass-id:coco-hm\")" + } + entity_selector_based_rule { + enabled = true + selector = "type(SERVICE),databaseName.exists(),toRelationship.calls(type(SERVICE),tag(\"compass-id:coco-hm\"))" + } + entity_selector_based_rule { + enabled = true + selector = "type(Service),tag(\"compass-id:coco-hm\")" + } + entity_selector_based_rule { + enabled = true + selector = "type(HOST),tag(\"compass-id:coco-hm\")" + } +}