MON-82 - alerting-message variables updated

This commit is contained in:
Alexandre Gaillet 2018-03-26 18:08:38 +02:00
parent ac1d515598
commit 65b8b2e8d0
3 changed files with 16 additions and 16 deletions

View File

@ -8,8 +8,8 @@ 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}"
oncall_24x7 = "${var.oncall_24x7}"
oncall_office_hours = "${var.oncall_office_hours}"
oncall_alert = "${var.oncall_alert}"
oncall_warning = "${var.oncall_warning}"
}
```
@ -29,8 +29,8 @@ 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 |
| oncall_alert | Define a broadcast channel for critical alerts | string | - | yes |
| oncall_warning | Define a broadcast channel for warning alerts | string | - | yes |
| prepend_text | Optional free text string to prepend to alert | string | `` | no |
Related documentation

View File

@ -1,10 +1,10 @@
variable "oncall_24x7" {
description = "Define PagerDuty NBH service name for alerts and nodata"
variable "oncall_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 "oncall_warning" {
description = "Define a broadcast channel for warning alerts"
type = "string"
}

View File

@ -1,17 +1,17 @@
data "template_file" "alerting-message" {
template = <<EOF
$${prepend_text}
{{#is_alert}}$${oncall_24x7}{{/is_alert}}
{{#is_recovery}}$${oncall_24x7}{{/is_recovery}}
{{#is_warning}}$${oncall_office_hours}{{/is_warning}}
{{#is_warning_recovery}}$${oncall_office_hours}{{/is_warning_recovery}}
{{#is_no_data}}$${oncall_24x7}{{/is_no_data}}
{{#is_alert}}$${oncall_alert}{{/is_alert}}
{{#is_recovery}}$${oncall_alert}{{/is_recovery}}
{{#is_warning}}$${oncall_warning}{{/is_warning}}
{{#is_warning_recovery}}$${oncall_warning}{{/is_warning_recovery}}
{{#is_no_data}}$${oncall_alert}{{/is_no_data}}
$${append_text}
EOF
vars {
oncall_24x7 = "${var.oncall_24x7}"
oncall_office_hours = "${var.oncall_office_hours}"
oncall_24x7 = "${var.oncall_alert}"
oncall_office_hours = "${var.oncall_warning}"
prepend_text = "${var.prepend_text}"
append_text = "${var.append_text}"
}