"Migrating from Monaco to Terraform for management zone: CD_MSGSVC"

CD_MSGSVC
Patryk Gudalewicz 2023-03-01 19:12:27 +01:00
parent 57ef9121ee
commit ad38b7ecf5
2 changed files with 90 additions and 0 deletions

View File

@ -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" ]
}
}
}

View File

@ -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
}
}