Merged in MON-82_alerting_messages (pull request #11)
MON-82: A generic module for DataDog Alerting (Pager) message Approved-by: Jérôme Respaut <shr3ps@gmail.com> Approved-by: Alexandre Gaillet <alexandre.gaillet@fr.clara.net> Approved-by: Quentin Manfroi <quentin.manfroi@yahoo.fr>
This commit is contained in:
commit
3382bdd15b
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,5 +1,6 @@
|
|||||||
# Ignore all volatile files
|
# Ignore all volatile files
|
||||||
**/.terraform/modules
|
**/.terraform/modules
|
||||||
|
**/.terraform/plugins
|
||||||
**/terraform.tfstate*.backup
|
**/terraform.tfstate*.backup
|
||||||
|
|
||||||
# Ignore all credentials files
|
# Ignore all credentials files
|
||||||
|
|||||||
17
common/alerting-message/inputs.tf
Normal file
17
common/alerting-message/inputs.tf
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
variable "oncall_24x7" {
|
||||||
|
type = "string"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "oncall_office_hours" {
|
||||||
|
type = "string"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "prepend_text" {
|
||||||
|
type = "string"
|
||||||
|
default = ""
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "append_text" {
|
||||||
|
type = "string"
|
||||||
|
default = ""
|
||||||
|
}
|
||||||
15
common/alerting-message/main.tf
Normal file
15
common/alerting-message/main.tf
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
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}}
|
||||||
|
$${append_text}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
vars {
|
||||||
|
oncall_24x7 = "${var.oncall_24x7}"
|
||||||
|
oncall_office_hours = "${var.oncall_office_hours}"
|
||||||
|
}
|
||||||
|
}
|
||||||
3
common/alerting-message/output.tf
Normal file
3
common/alerting-message/output.tf
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
output "alerting-message" {
|
||||||
|
value = "${data.template_file.alerting-message.rendered}"
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user