diff --git a/common/alerting-message/README.md b/common/alerting-message/README.md index 60315f0..86eff6f 100644 --- a/common/alerting-message/README.md +++ b/common/alerting-message/README.md @@ -6,10 +6,11 @@ How to use this module ``` module "datadog-message-alerting" { - source = "git::ssh://git@bitbucket.org/morea/terraform.feature.datadog.git//common/alerting-message?ref={revision}" + source = "git::ssh://git@bitbucket.org/morea/terraform.feature.datadog.git//common/alerting-message?ref={revision}" - oncall_24x7 = "${var.oncall_24x7}" - oncall_office_hours = "${var.oncall_office_hours}" + message_alert = "${var.oncall_24x7}" + message_warning = "${var.oncall_business_hours}" + message_nodata = "${var.oncall_nodata}" } ``` @@ -18,8 +19,9 @@ Purpose Creates a DataDog monitor alert message with the following inputs : -* PagerDuty NBH service name -* PagerDuty BH service name +* A broadcast channel for critical alerts +* A broadcast channel for nodata alerts +* A broadcast channel for warning alerts * Prepend test free string * Append text free string @@ -29,8 +31,9 @@ Inputs | Name | Description | Type | Default | Required | |------|-------------|:----:|:-----:|:-----:| | append_text | Optional free text string to append to alert | string | `` | no | -| oncall_24x7 | Define PagerDuty NBH service name for alerts and nodata | string | - | yes | -| oncall_office_hours | Define PagerDuty BH service name for warning alerts | string | - | yes | +| message_alert | Define a broadcast channel for critical alerts | string | - | yes | +| message_nodata | Define a broadcast channel for nodata alerts | string | `` | no | +| message_warning | Define a broadcast channel for warning alerts | string | - | yes | | prepend_text | Optional free text string to prepend to alert | string | `` | no | Related documentation diff --git a/common/alerting-message/inputs.tf b/common/alerting-message/inputs.tf index 8422020..7a0e3ec 100644 --- a/common/alerting-message/inputs.tf +++ b/common/alerting-message/inputs.tf @@ -1,13 +1,19 @@ -variable "oncall_24x7" { - description = "Define PagerDuty NBH service name for alerts and nodata" +variable "message_alert" { + description = "Define a broadcast channel for critical alerts" type = "string" } -variable "oncall_office_hours" { - description = "Define PagerDuty BH service name for warning alerts" +variable "message_warning" { + description = "Define a broadcast channel for warning alerts" type = "string" } +variable "message_nodata" { + description = "Define a broadcast channel for nodata alerts" + type = "string" + default = "" +} + variable "prepend_text" { description = "Optional free text string to prepend to alert" type = "string" diff --git a/common/alerting-message/main.tf b/common/alerting-message/main.tf index cc45af5..81b3369 100644 --- a/common/alerting-message/main.tf +++ b/common/alerting-message/main.tf @@ -1,18 +1,20 @@ data "template_file" "alerting-message" { template = <