MON-82 - Variables names changed for better understanding
This commit is contained in:
parent
aea54196f6
commit
7353408d47
@ -8,9 +8,9 @@ How to use this module
|
|||||||
module "datadog-message-alerting" {
|
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_alert = "${var.message_alert}"
|
message_alert = "${var.oncall_24x7}"
|
||||||
oncall_warning = "${var.message_warning}"
|
message_warning = "${var.oncall_business_hours}"
|
||||||
oncall_nodata = "${var.message_nodata}"
|
message_nodata = "${var.oncall_nodata}"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -19,8 +19,9 @@ Purpose
|
|||||||
|
|
||||||
Creates a DataDog monitor alert message with the following inputs :
|
Creates a DataDog monitor alert message with the following inputs :
|
||||||
|
|
||||||
* PagerDuty NBH service name
|
* A broadcast channel for critical alerts
|
||||||
* PagerDuty BH service name
|
* A broadcast channel for nodata alerts
|
||||||
|
* A broadcast channel for warning alerts
|
||||||
* Prepend test free string
|
* Prepend test free string
|
||||||
* Append text free string
|
* Append text free string
|
||||||
|
|
||||||
@ -30,9 +31,9 @@ Inputs
|
|||||||
| Name | Description | Type | Default | Required |
|
| Name | Description | Type | Default | Required |
|
||||||
|------|-------------|:----:|:-----:|:-----:|
|
|------|-------------|:----:|:-----:|:-----:|
|
||||||
| append_text | Optional free text string to append to alert | string | `` | no |
|
| append_text | Optional free text string to append to alert | string | `` | no |
|
||||||
| oncall_alert | Define a broadcast channel for critical alerts | string | - | yes |
|
| message_alert | Define a broadcast channel for critical alerts | string | - | yes |
|
||||||
| oncall_nodata | Define a broadcast channel for nodata alerts | string | `` | no |
|
| message_nodata | Define a broadcast channel for nodata alerts | string | `` | no |
|
||||||
| oncall_warning | Define a broadcast channel for warning alerts | string | - | yes |
|
| message_warning | Define a broadcast channel for warning alerts | string | - | yes |
|
||||||
| prepend_text | Optional free text string to prepend to alert | string | `` | no |
|
| prepend_text | Optional free text string to prepend to alert | string | `` | no |
|
||||||
|
|
||||||
Related documentation
|
Related documentation
|
||||||
|
|||||||
@ -1,14 +1,14 @@
|
|||||||
variable "oncall_alert" {
|
variable "message_alert" {
|
||||||
description = "Define a broadcast channel for critical alerts"
|
description = "Define a broadcast channel for critical alerts"
|
||||||
type = "string"
|
type = "string"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "oncall_warning" {
|
variable "message_warning" {
|
||||||
description = "Define a broadcast channel for warning alerts"
|
description = "Define a broadcast channel for warning alerts"
|
||||||
type = "string"
|
type = "string"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "oncall_nodata" {
|
variable "message_nodata" {
|
||||||
description = "Define a broadcast channel for nodata alerts"
|
description = "Define a broadcast channel for nodata alerts"
|
||||||
type = "string"
|
type = "string"
|
||||||
default = ""
|
default = ""
|
||||||
|
|||||||
@ -1,23 +1,23 @@
|
|||||||
locals {
|
locals {
|
||||||
oncall_nodata = "${var.oncall_nodata == "" ? var.oncall_alert : var.oncall_nodata}"
|
oncall_nodata = "${var.message_nodata == "" ? var.message_alert : var.message_nodata}"
|
||||||
}
|
}
|
||||||
|
|
||||||
data "template_file" "alerting-message" {
|
data "template_file" "alerting-message" {
|
||||||
template = <<EOF
|
template = <<EOF
|
||||||
$${prepend_text}
|
$${prepend_text}
|
||||||
{{#is_alert}}$${oncall_alert}{{/is_alert}}
|
{{#is_alert}}$${message_alert}{{/is_alert}}
|
||||||
{{#is_recovery}}$${oncall_alert}{{/is_recovery}}
|
{{#is_recovery}}$${message_alert}{{/is_recovery}}
|
||||||
{{#is_warning}}$${oncall_warning}{{/is_warning}}
|
{{#is_warning}}$${message_warning}{{/is_warning}}
|
||||||
{{#is_warning_recovery}}$${oncall_warning}{{/is_warning_recovery}}
|
{{#is_warning_recovery}}$${message_warning}{{/is_warning_recovery}}
|
||||||
{{#is_no_data}}$${oncall_nodata}{{/is_no_data}}
|
{{#is_no_data}}$${message_nodata}{{/is_no_data}}
|
||||||
{{#is_no_data_recovery}}$${oncall_nodata}{{/is_no_data_recovery}}
|
{{#is_no_data_recovery}}$${message_nodata}{{/is_no_data_recovery}}
|
||||||
$${append_text}
|
$${append_text}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
vars {
|
vars {
|
||||||
oncall_alert = "${var.oncall_alert}"
|
message_alert = "${var.message_alert}"
|
||||||
oncall_warning = "${var.oncall_warning}"
|
message_warning = "${var.message_warning}"
|
||||||
oncall_nodata = "${local.oncall_nodata}"
|
message_nodata = "${local.oncall_nodata}"
|
||||||
prepend_text = "${var.prepend_text}"
|
prepend_text = "${var.prepend_text}"
|
||||||
append_text = "${var.append_text}"
|
append_text = "${var.append_text}"
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user