From 5762a8dab44231104295a0b6bc99035d372162cf Mon Sep 17 00:00:00 2001 From: Farley Date: Sat, 13 Feb 2021 16:35:28 +1300 Subject: [PATCH] Adding anomaly band width variable and more variables into readme help --- README.md | 8 ++++++++ main.tf | 2 +- variables.tf | 6 ++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1954639..046386f 100644 --- a/README.md +++ b/README.md @@ -58,12 +58,20 @@ module "aws-rds-alarms" { | actions\_alarm | A list of actions to take when alarms are triggered. Will likely be an SNS topic for event distribution. | `list` | `[]` | no | | actions\_ok | A list of actions to take when alarms are cleared. Will likely be an SNS topic for event distribution. | `list` | `[]` | no | | anomaly\_period | The number of seconds that make each evaluation period for anomaly detection. | `string` | `"600"` | no | +| anomaly_band_width | The width of the anomaly band detection. Higher numbers means less sensitive | `string` | `"2"` | no | | db\_instance\_id | RDS Instance ID | `string` | n/a | yes | | evaluation\_period | The evaluation period over which to use when triggering alarms. | `string` | `"5"` | no | | prefix | Alarm Name Prefix | `string` | `""` | no | | statistic\_period | The number of seconds that make each statistic period. | `string` | `"60"` | no | | tags | Tags to attach to each alarm | `map(string)` | `{}` | no | | db_instance_class | The rds instance-class, e.g. `db.t3.medium` | `string` | | yes | +| cpu_utilization_too_high_threshold | Alarm threshold for the 'highCPUUtilization' alarm | `string` | `"90"` | no | +| cpu_credit_balance_too_low_threshold | Alarm threshold for the 'lowCPUCreditBalance' alarm | `string` | `"100"` | no | +| disk_queue_depth_too_high_threshold | Alarm threshold for the 'highDiskQueueDepth' alarm | `string` | `"64"` | no | +| disk_free_storage_space_too_low_threshold | Alarm threshold for the 'lowFreeStorageSpace' alarm (in bytes) | `string` | `"10000000000"` | no | +| disk_burst_balance_too_low_threshold | Alarm threshold for the 'lowEBSBurstBalance' alarm | `string` | `"100"` | no | +| memory_freeable_too_low_threshold | Alarm threshold for the 'lowFreeableMemory' alarm (in bytes) | `string` | `"256000000"` | no | +| memory_swap_usage_too_high_threshold | Alarm threshold for the 'highSwapUsage' alarm (in bytes) | `string` | `"256000000"` | no | ## Outputs diff --git a/main.tf b/main.tf index 5cd7ebc..d860376 100644 --- a/main.tf +++ b/main.tf @@ -147,7 +147,7 @@ resource "aws_cloudwatch_metric_alarm" "connection_count_anomalous" { metric_query { id = "e1" - expression = "ANOMALY_DETECTION_BAND(m1)" + expression = "ANOMALY_DETECTION_BAND(m1, ${var.anomaly_band_width})" label = "DatabaseConnections (Expected)" return_data = "true" } diff --git a/variables.tf b/variables.tf index 7e183bb..a45c69b 100644 --- a/variables.tf +++ b/variables.tf @@ -27,6 +27,12 @@ variable "anomaly_period" { description = "The number of seconds that make each evaluation period for anomaly detection." } +variable "anomaly_band_width" { + type = string + default = "2" + description = "The width of the anomaly band, default 2. Higher numbers means less sensitive." +} + variable "actions_alarm" { type = list default = []