MON-82: A generic module for DataDog Alerting (Pager) message
This commit is contained in:
parent
ac6e0d69e1
commit
17b507fa2d
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
|
||||||
|
|||||||
7
common/alerting-message/inputs.tf
Normal file
7
common/alerting-message/inputs.tf
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
variable "oncall_24x7" {
|
||||||
|
type = "string"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "oncall_office_hours" {
|
||||||
|
type = "string"
|
||||||
|
}
|
||||||
13
common/alerting-message/main.tf
Normal file
13
common/alerting-message/main.tf
Normal 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}"
|
||||||
|
}
|
||||||
|
}
|
||||||
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