diff --git a/NA_PROD/alerting/cd_msgsvc_prod.tf b/NA_PROD/alerting/cd_msgsvc_prod.tf new file mode 100644 index 00000000..ad4c84bc --- /dev/null +++ b/NA_PROD/alerting/cd_msgsvc_prod.tf @@ -0,0 +1,38 @@ +# DEFINE dynatrace_alerting.CD_MSGSVC_PROD.id = vu9U3hXa3q0AAAABABhidWlsdGluOmFsZXJ0aW5nLnByb2ZpbGUABnRlbmFudAAGdGVuYW50ACRmMDAzZDMyMy1jM2M0LTMxNjItYjU1Ni1jNWRjZWQzZTNhMTW-71TeFdrerQ +data "dynatrace_management_zone" "CD_MSGSVC_PROD"{ name="CD_MSGSVC" } +resource "dynatrace_alerting" "CD_MSGSVC_PROD" { + name = "CD_MSGSVC PROD" + management_zone = data.dynatrace_management_zone.CD_MSGSVC_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_msgsvc.tf b/NA_PROD/management_zone/cd_msgsvc.tf new file mode 100644 index 00000000..d26beb67 --- /dev/null +++ b/NA_PROD/management_zone/cd_msgsvc.tf @@ -0,0 +1,52 @@ +# DEFINE dynatrace_management_zone.CD_MSGSVC.id = -2860157158289177033 +resource "dynatrace_management_zone" "CD_MSGSVC" { + name = "CD_MSGSVC" + entity_selector_based_rule { + enabled = true + selector =<<-EOT + type(Service),tag("compass-id:msgsvc","compass-id:msgsvc-vcs") + EOT + } + entity_selector_based_rule { + enabled = true + selector =<<-EOT + type(SERVICE),databaseName.exists(),toRelationship.calls(type(SERVICE),tag("compass-id:msgsvc","compass-id:msgsvc-vcs")) + EOT + } + entity_selector_based_rule { + enabled = true + selector =<<-EOT + type(PROCESS_GROUP_INSTANCE),tag("compass-id:msgsvc","compass-id:msgsvc-vcs") + EOT + } + entity_selector_based_rule { + enabled = true + selector =<<-EOT + type(HOST),tag("compass-id:msgsvc","compass-id:msgsvc-vcs") + EOT + } + entity_selector_based_rule { + enabled = true + selector =<<-EOT + type(Service),tag("app-id:APP-18544","[AWS]APP-ID:APP-18544") + EOT + } + entity_selector_based_rule { + enabled = true + selector =<<-EOT + type(SERVICE),databaseName.exists(),toRelationship.calls(type(SERVICE),tag("app-id:APP-18544","[AWS]APP-ID:APP-18544")) + EOT + } + entity_selector_based_rule { + enabled = true + selector =<<-EOT + type(PROCESS_GROUP_INSTANCE),tag("app-id:APP-18544","[AWS]APP-ID:APP-18544") + EOT + } + entity_selector_based_rule { + enabled = true + selector =<<-EOT + type(HOST),tag("app-id:APP-18544","[AWS]APP-ID:APP-18544") + EOT + } +}