From c57aaf240ffbf94c5cad4fc000a83afdeafa9d85 Mon Sep 17 00:00:00 2001 From: bennsimon Date: Tue, 3 Dec 2024 10:43:57 +0300 Subject: [PATCH] add dimension config to slow metric alrm --- storage.tf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/storage.tf b/storage.tf index 4613ae9..d9510b6 100644 --- a/storage.tf +++ b/storage.tf @@ -340,4 +340,8 @@ resource "aws_cloudwatch_metric_alarm" "slow_query_metric_alarm" { notification_type = var.postgresql_slow_query_notification_type severity = var.postgresql_slow_query_severity } + + dimensions = { + DBInstanceIdentifier = (length(var.postgresql_source_snapshot_identifier) == 0 && var.postgresql_replicate_source_db == null) ? aws_db_instance.blank-database[0].identifier : var.postgresql_replicate_source_db != null ? aws_db_instance.replica-database[0].identifier : aws_db_instance.from-snapshot[0].identifier + } }