diff --git a/modules/ManagementGovernance/Monitoring.RDS/main.tf b/modules/ManagementGovernance/Monitoring.RDS/main.tf index 9ac24bf..0edf854 100644 --- a/modules/ManagementGovernance/Monitoring.RDS/main.tf +++ b/modules/ManagementGovernance/Monitoring.RDS/main.tf @@ -88,4 +88,50 @@ resource aws_cloudwatch_metric_alarm rds-DiskQueueDepth { lifecycle { ignore_changes = [tags] } +} + +resource aws_cloudwatch_metric_alarm rds-ReadLetency { + alarm_name = "RDS:ReadLetency:${var.rds-instance-name}" + comparison_operator = "GreaterThanThreshold" + evaluation_periods = "2" + metric_name = "ReadLetency" + period = "600" + statistic = "Average" + threshold = var.threshold-ReadLetency + alarm_description = "RDS:ReadLetency" + namespace = "AWS/RDS" + insufficient_data_actions = [] + actions_enabled = "true" + alarm_actions = [var.alarm-actions-urgent] + ok_actions = [var.alarm-actions-urgent] + dimensions = { + DBInstanceIdentifier = var.rds-instance-name + } + tags = var.default-tags + lifecycle { + ignore_changes = [tags] + } +} + +resource aws_cloudwatch_metric_alarm rds-WriteLetency { + alarm_name = "RDS:WriteLetency:${var.rds-instance-name}" + comparison_operator = "GreaterThanThreshold" + evaluation_periods = "2" + metric_name = "WriteLetency" + period = "600" + statistic = "Average" + threshold = var.threshold-WriteLetency + alarm_description = "RDS:WriteLetency" + namespace = "AWS/RDS" + insufficient_data_actions = [] + actions_enabled = "true" + alarm_actions = [var.alarm-actions-urgent] + ok_actions = [var.alarm-actions-urgent] + dimensions = { + DBInstanceIdentifier = var.rds-instance-name + } + tags = var.default-tags + lifecycle { + ignore_changes = [tags] + } } \ No newline at end of file diff --git a/modules/ManagementGovernance/Monitoring.RDS/variables.tf b/modules/ManagementGovernance/Monitoring.RDS/variables.tf index e292baa..2ead58a 100644 --- a/modules/ManagementGovernance/Monitoring.RDS/variables.tf +++ b/modules/ManagementGovernance/Monitoring.RDS/variables.tf @@ -20,4 +20,6 @@ variable default-tags {} variable threshold-FreeableMemory {} variable threshold-CpuUtilization {} variable threshold-FreeStorageSpace {} -variable threshold-DiskQueueDepth {} \ No newline at end of file +variable threshold-DiskQueueDepth {} +variable threshold-ReadLetency {} +variable threshold-WriteLetency {} \ No newline at end of file