diff --git a/terraform/environments/init.tf b/terraform/environments/init.tf index 7fe737b4e9b827b39fdb567e08a6ae173fcb8d5f..9937cd727c210e81282f232b0a2d27da100742f5 100644 --- a/terraform/environments/init.tf +++ b/terraform/environments/init.tf @@ -13,6 +13,14 @@ data "terraform_remote_state" "holi_infra_state" { } } +data "terraform_remote_state" "holi_infra_monitoring_state" { + backend = "gcs" + config = { + bucket = "holi-shared-terraform-state" + prefix = "infra-monitoring" + } +} + data "terraform_remote_state" "holi_chat_server_common_state" { backend = "gcs" config = { diff --git a/terraform/environments/monitoring.tf b/terraform/environments/monitoring.tf index 71c318c28ce293a5a65ab9c086ac58d0fa1f6388..f8643c0be8291cf21b41ac68e591eee165046004 100644 --- a/terraform/environments/monitoring.tf +++ b/terraform/environments/monitoring.tf @@ -1,7 +1,7 @@ resource "google_monitoring_alert_policy" "chat_server_cpu_utilization" { count = local.environment == "production" ? 1 : 0 display_name = "COMO: Production chat server CPU utilization exceeded" - notification_channels = [data.terraform_remote_state.holi_infra_state.outputs.monitoring_notification_channel_rocket_chat_production_id] + notification_channels = [data.terraform_remote_state.holi_infra_monitoring_state.outputs.monitoring_notification_channel_rocket_chat_production_id] severity = "WARNING" alert_strategy { auto_close = "86400s" # 1 day @@ -41,7 +41,7 @@ resource "google_monitoring_alert_policy" "chat_server_cpu_utilization" { resource "google_monitoring_alert_policy" "chat_server_memory_utilization" { count = local.environment == "production" ? 1 : 0 display_name = "COMO: ${local.environment} chat server memory utilization exceeded" - notification_channels = [data.terraform_remote_state.holi_infra_state.outputs.monitoring_notification_channel_rocket_chat_production_id] + notification_channels = [data.terraform_remote_state.holi_infra_monitoring_state.outputs.monitoring_notification_channel_rocket_chat_production_id] severity = "WARNING" alert_strategy { auto_close = "86400s" # 1 day