MON-82: A generic module for DataDog Alerting (Pager) message

This commit is contained in:
Jérôme Respaut 2017-10-30 15:59:15 +01:00
parent ac6e0d69e1
commit 17b507fa2d
4 changed files with 24 additions and 0 deletions

1
.gitignore vendored
View File

@ -1,5 +1,6 @@
# Ignore all volatile files
**/.terraform/modules
**/.terraform/plugins
**/terraform.tfstate*.backup
# Ignore all credentials files

View File

@ -0,0 +1,7 @@
variable "oncall_24x7" {
type = "string"
}
variable "oncall_office_hours" {
type = "string"
}

View File

@ -0,0 +1,13 @@
data "template_file" "alerting-message" {
template = <<EOF
{{#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}}
EOF
vars {
oncall_24x7 = "${var.oncall_24x7}"
oncall_office_hours = "${var.oncall_office_hours}"
}
}

View File

@ -0,0 +1,3 @@
output "alerting-message" {
value = "${data.template_file.alerting-message.rendered}"
}