Skip to content

Commit

Permalink
update cloudmetrics db-instance-identifier-attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
bennsimon committed Nov 27, 2024
1 parent d3fccde commit cc83b0b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions storage.tf
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ resource "aws_cloudwatch_metric_alarm" "db-connections" {
insufficient_data_actions = var.postgresql_alarm_insufficient_data_actions

dimensions = {
DBInstanceIdentifier = (length(var.postgresql_source_snapshot_identifier) == 0 && var.postgresql_replicate_source_db == null) ? aws_db_instance.blank-database[0].id : var.postgresql_replicate_source_db != null ? aws_db_instance.replica-database[0].id : aws_db_instance.from-snapshot[0].id
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
}
}

Expand All @@ -223,7 +223,7 @@ resource "aws_cloudwatch_metric_alarm" "cpu_utilization_too_high" {
ok_actions = var.postgresql_ok_actions

dimensions = {
DBInstanceIdentifier = (length(var.postgresql_source_snapshot_identifier) == 0 && var.postgresql_replicate_source_db == null) ? aws_db_instance.blank-database[0].id : var.postgresql_replicate_source_db != null ? aws_db_instance.replica-database[0].id : aws_db_instance.from-snapshot[0].id
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
}
}

Expand All @@ -241,7 +241,7 @@ resource "aws_cloudwatch_metric_alarm" "free_storage_space_too_low" {
ok_actions = var.postgresql_ok_actions

dimensions = {
DBInstanceIdentifier = (length(var.postgresql_source_snapshot_identifier) == 0 && var.postgresql_replicate_source_db == null) ? aws_db_instance.blank-database[0].id : var.postgresql_replicate_source_db != null ? aws_db_instance.replica-database[0].id : aws_db_instance.from-snapshot[0].id
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
}
}

Expand All @@ -259,7 +259,7 @@ resource "aws_cloudwatch_metric_alarm" "freeable_memory_too_low" {
ok_actions = var.postgresql_ok_actions

dimensions = {
DBInstanceIdentifier = (length(var.postgresql_source_snapshot_identifier) == 0 && var.postgresql_replicate_source_db == null) ? aws_db_instance.blank-database[0].id : var.postgresql_replicate_source_db != null ? aws_db_instance.replica-database[0].id : aws_db_instance.from-snapshot[0].id
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
}
}

Expand Down

0 comments on commit cc83b0b

Please sign in to comment.