From 9543c88401cc343c8a04609f08e9f3525972c038 Mon Sep 17 00:00:00 2001 From: jbonnier Date: Mon, 13 Nov 2023 16:43:05 -0500 Subject: [PATCH] feat: Add an `ecs_alarm_description` variable to be passed to an underlying module --- README.md | 1 + main.tf | 2 ++ variables.tf | 6 ++++++ 3 files changed, 9 insertions(+) diff --git a/README.md b/README.md index fb31e8d..a864e1a 100644 --- a/README.md +++ b/README.md @@ -154,6 +154,7 @@ module "ecs_app" { | [delimiter](#input\_delimiter) | Delimiter to be used between ID elements.
Defaults to `-` (hyphen). Set to `""` to use no delimiter at all. | `string` | `null` | no | | [descriptor\_formats](#input\_descriptor\_formats) | Describe additional descriptors to be output in the `descriptors` output map.
Map of maps. Keys are names of descriptors. Values are maps of the form
`{
format = string
labels = list(string)
}`
(Type is `any` so the map values can later be enhanced to provide additional options.)
`format` is a Terraform format string to be passed to the `format()` function.
`labels` is a list of labels, in order, to pass to `format()` function.
Label values will be normalized before being passed to `format()` so they will be
identical to how they appear in `id`.
Default is `{}` (`descriptors` output will be empty). | `any` | `{}` | no | | [dns\_alias\_enabled](#input\_dns\_alias\_enabled) | Create a DNS alias for the CDN. Requires `parent_zone_id` or `parent_zone_name`. | `bool` | `false` | no | +| [ecs\_alarm\_description](#input\_ecs\_alarm\_description) | The string to format and use as the ECS alarm description. | `string` | `"Average service %v utilization %v last %f minute(s) over %v period(s)"` | no | | [ecs\_alarms\_cpu\_utilization\_high\_alarm\_actions](#input\_ecs\_alarms\_cpu\_utilization\_high\_alarm\_actions) | A list of ARNs (i.e. SNS Topic ARN) to notify on CPU Utilization High Alarm action. | `list(string)` | `[]` | no | | [ecs\_alarms\_cpu\_utilization\_high\_evaluation\_periods](#input\_ecs\_alarms\_cpu\_utilization\_high\_evaluation\_periods) | Number of periods to evaluate for the alarm. | `number` | `1` | no | | [ecs\_alarms\_cpu\_utilization\_high\_ok\_actions](#input\_ecs\_alarms\_cpu\_utilization\_high\_ok\_actions) | A list of ARNs (i.e. SNS Topic ARN) to notify on CPU Utilization High OK action. | `list(string)` | `[]` | no | diff --git a/main.tf b/main.tf index 4efbe16..c8dcfd3 100644 --- a/main.tf +++ b/main.tf @@ -243,6 +243,8 @@ module "ecs_alarms" { )) memory_utilization_low_ok_actions = var.ecs_alarms_memory_utilization_low_ok_actions + alarm_description = var.ecs_alarm_description + context = module.this.context } diff --git a/variables.tf b/variables.tf index 90c20cd..dae30c0 100644 --- a/variables.tf +++ b/variables.tf @@ -333,6 +333,12 @@ variable "ecs_alarms_enabled" { description = "Whether to enable SNS alarms for the ECS service." } +variable "ecs_alarm_description" { + type = string + default = "Average service %v utilization %v last %f minute(s) over %v period(s)" + description = "The string to format and use as the ECS alarm description." +} + variable "ecs_alarms_cpu_utilization_high_threshold" { type = number default = 80