From f2fa06905fb54c0cff52b6c5d6a86a92924bb1e1 Mon Sep 17 00:00:00 2001 From: Patryk Gudalewicz Date: Wed, 1 Mar 2023 18:57:39 +0100 Subject: [PATCH] "Migrating from Monaco to Terraform for management zone: CD_SMACC_BE" --- EMEA_PREPROD/management_zone/cd_smacc_be.tf | 260 ++++++++++++++++++++ 1 file changed, 260 insertions(+) create mode 100644 EMEA_PREPROD/management_zone/cd_smacc_be.tf diff --git a/EMEA_PREPROD/management_zone/cd_smacc_be.tf b/EMEA_PREPROD/management_zone/cd_smacc_be.tf new file mode 100644 index 00000000..7f96ad0b --- /dev/null +++ b/EMEA_PREPROD/management_zone/cd_smacc_be.tf @@ -0,0 +1,260 @@ +# DEFINE dynatrace_management_zone.CD_SMACC_BE.id = 3956159049968100981 +resource "dynatrace_management_zone" "CD_SMACC_BE" { + name = "CD_SMACC_BE" + entity_selector_based_rule { + # enabled = false + selector = "type(PROCESS_GROUP_INSTANCE),tag('ms-id:smc2-bl')" + } + entity_selector_based_rule { + enabled = true + selector = "type(Service),tag(\"ms-id:smc2-bl\")" + } + entity_selector_based_rule { + # enabled = false + selector = "type(HOST),tag('msid:smc2-bl')" + } + entity_selector_based_rule { + # enabled = false + selector = "type(SERVICE),databaseName.exists(),toRelationship.calls(type(SERVICE),tag('msid:smc2-bl'))" + } + entity_selector_based_rule { + # enabled = false + selector = "type(PROCESS_GROUP_INSTANCE),tag('msid:smc2-bl')" + } + entity_selector_based_rule { + enabled = true + selector = "type(SERVICE),databaseName.exists(),toRelationship.calls(type(SERVICE),tag(\"ms-id:smc2-bl\"))" + } + entity_selector_based_rule { + enabled = true + selector = "type(HOST),tag(\"ms-id:smc2-bl\")" + } + entity_selector_based_rule { + # enabled = false + selector = "type(Service),tag('msid:smc2-bl')" + } + entity_selector_based_rule { + enabled = true + selector = "type(PROCESS_GROUP_INSTANCE),tag(\"ms-id:smc2-bl\")" + } + entity_selector_based_rule { + # enabled = false + selector = "type(Service),tag('ms-id:smc2-bl')" + } + entity_selector_based_rule { + # enabled = false + selector = "type(HOST),tag('ms-id:smc2-bl')" + } + entity_selector_based_rule { + # enabled = false + selector = "type(SERVICE),databaseName.exists(),toRelationship.calls(type(SERVICE),tag('ms-id:smc2-bl'))" + } + rules { + type = "SERVICE" + # enabled = false + conditions { + key { + type = "STATIC" + attribute = "SERVICE_NAME" + } + string { + case_sensitive = true + # negate = false + operator = "CONTAINS" + value = "public n" + } + } + } + rules { + type = "SERVICE" + # enabled = false + conditions { + key { + type = "STATIC" + attribute = "SERVICE_NAME" + } + string { + case_sensitive = true + # negate = false + operator = "CONTAINS" + value = "unmonitored" + } + } + } + rules { + type = "SERVICE" + # enabled = false + propagation_types = [ "SERVICE_TO_HOST_LIKE", "SERVICE_TO_PROCESS_GROUP_LIKE" ] + conditions { + key { + type = "STATIC" + attribute = "SERVICE_NAME" + } + string { + case_sensitive = true + negate = true + operator = "EQUALS" + value = "HealthResource" + } + } + conditions { + key { + type = "STATIC" + attribute = "SERVICE_NAME" + } + string { + case_sensitive = true + negate = true + operator = "EQUALS" + value = "MetricsResource" + } + } + conditions { + key { + type = "STATIC" + attribute = "SERVICE_NAME" + } + string { + case_sensitive = true + negate = true + operator = "EQUALS" + value = "PingResource" + } + } + conditions { + key { + type = "STATIC" + attribute = "SERVICE_NAME" + } + string { + case_sensitive = true + negate = true + operator = "EQUALS" + value = "PrometheusResource" + } + } + conditions { + key { + type = "STATIC" + attribute = "SERVICE_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "SMACC-BE" + } + } + } + } + rules { + type = "SERVICE" + # enabled = false + propagation_types = [ "SERVICE_TO_HOST_LIKE", "SERVICE_TO_PROCESS_GROUP_LIKE" ] + conditions { + key { + type = "STATIC" + attribute = "SERVICE_NAME" + } + string { + case_sensitive = true + negate = true + operator = "EQUALS" + value = "HealthResource" + } + } + conditions { + key { + type = "STATIC" + attribute = "SERVICE_NAME" + } + string { + case_sensitive = true + negate = true + operator = "EQUALS" + value = "MetricsResource" + } + } + conditions { + key { + type = "STATIC" + attribute = "SERVICE_NAME" + } + string { + case_sensitive = true + negate = true + operator = "EQUALS" + value = "PingResource" + } + } + conditions { + key { + type = "STATIC" + attribute = "SERVICE_NAME" + } + string { + case_sensitive = true + negate = true + operator = "EQUALS" + value = "PrometheusResource" + } + } + conditions { + key { + type = "STATIC" + attribute = "SERVICE_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "SMACC-KTS" + } + } + } + } + rules { + type = "PROCESS_GROUP" + # enabled = false + propagation_types = [ "PROCESS_GROUP_TO_HOST" ] + conditions { + key { + type = "STATIC" + attribute = "PROCESS_GROUP_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "SMACC-BE" + } + } + } + } + rules { + type = "PROCESS_GROUP" + # enabled = false + propagation_types = [ "PROCESS_GROUP_TO_HOST" ] + conditions { + key { + type = "STATIC" + attribute = "PROCESS_GROUP_TAGS" + } + tag { + # negate = false + operator = "EQUALS" + value { + context = "CONTEXTLESS" + key = "Component" + value = "SMACC-KTS" + } + } + } + } +}