Skip to content

Commit

Permalink
Merge pull request #1452 from alphagov/samsimpson1/rds-alarms
Browse files Browse the repository at this point in the history
Fix RDS free space cloudwatch alarm
  • Loading branch information
samsimpson1 authored Oct 2, 2024
2 parents 62d5dde + c940dd3 commit 4e094a7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions terraform/deployments/rds/rds.tf
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ resource "aws_db_event_subscription" "subscription" {
# Alarm if free storage space is below threshold (typically 10 GiB) for 10m.
resource "aws_cloudwatch_metric_alarm" "rds_freestoragespace" {
for_each = var.databases
dimensions = { DBInstanceIdentifier = aws_db_instance.instance[each.key].id }
dimensions = { DBInstanceIdentifier = aws_db_instance.instance[each.key].identifier }

alarm_name = "${each.value.name}-rds-freestoragespace"
alarm_name = "${aws_db_instance.instance[each.key].identifier}-rds-freestoragespace"
comparison_operator = "LessThanThreshold"
evaluation_periods = "10"
metric_name = "FreeStorageSpace"
Expand All @@ -93,7 +93,7 @@ resource "aws_cloudwatch_metric_alarm" "rds_freestoragespace" {
statistic = "Minimum"
threshold = each.value.freestoragespace_threshold
alarm_actions = [data.terraform_remote_state.infra_monitoring.outputs.sns_topic_cloudwatch_alarms_arn]
alarm_description = "Available storage space on ${each.value.name} RDS is too low."
alarm_description = "Available storage space on ${aws_db_instance.instance[each.key].identifier} RDS is too low."
}

resource "aws_route53_record" "instance_cname" {
Expand Down

0 comments on commit 4e094a7

Please sign in to comment.