diff --git a/common/alerting-message/README.md b/common/alerting-message/README.md new file mode 100644 index 0000000..067682e --- /dev/null +++ b/common/alerting-message/README.md @@ -0,0 +1,42 @@ +Alerting Message Datadog Generator +================================== + +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}" + + message_alert = "${var.oncall_24x7}" + message_warning = "${var.oncall_business_hours}" + message_nodata = "${var.oncall_nodata}" +} +``` + +Purpose +------- + +Creates a DataDog monitor alert message with the following inputs : + +* A broadcast channel for critical alerts +* A broadcast channel for nodata alerts +* A broadcast channel for warning alerts +* Prepend text free string +* Append text free string + +Inputs +------ + +| Name | Description | Type | Default | Required | +|------|-------------|:----:|:-----:|:-----:| +| append_text | Optional free text string to append to alert | string | `` | no | +| 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 +--------------------- + +DataDog documentation: [https://docs.datadoghq.com/integrations/azure_app_services](https://docs.datadoghq.com/integrations/azure_app_services) diff --git a/common/alerting-message/inputs.tf b/common/alerting-message/inputs.tf index f20bef7..7a0e3ec 100644 --- a/common/alerting-message/inputs.tf +++ b/common/alerting-message/inputs.tf @@ -1,17 +1,27 @@ -variable "oncall_24x7" { - type = "string" +variable "message_alert" { + description = "Define a broadcast channel for critical alerts" + type = "string" } -variable "oncall_office_hours" { - type = "string" +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" { - type = "string" - default = "" + description = "Optional free text string to prepend to alert" + type = "string" + default = "" } variable "append_text" { - type = "string" - default = "" + description = "Optional free text string to append to alert" + type = "string" + default = "" } 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 = <