forked from vistaprint/terraform-newrelic-monitoring
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvictorops.tf
37 lines (28 loc) · 1.03 KB
/
victorops.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
resource "newrelic_alert_channel" "victorops_non_urgent" {
count = var.enable_victorops_notifications ? 1 : 0
name = "${var.newrelic_app_name} Non Urgent"
type = "victorops"
configuration = {
key = var.victorops_api_key
route_key = var.victorops_non_urgent_routing_key
}
}
resource "newrelic_alert_channel" "victorops_urgent" {
count = var.enable_victorops_notifications ? 1 : 0
name = "${var.newrelic_app_name} Urgent"
type = "victorops"
configuration = {
key = var.victorops_api_key
route_key = var.victorops_urgent_routing_key
}
}
resource "newrelic_alert_policy_channel" "victorops_non_urgent" {
count = var.enable_victorops_notifications ? 1 : 0
policy_id = newrelic_alert_policy.non_urgent.id
channel_id = newrelic_alert_channel.victorops_non_urgent.0.id
}
resource "newrelic_alert_policy_channel" "victorops_urgent" {
count = var.enable_victorops_notifications ? 1 : 0
policy_id = newrelic_alert_policy.urgent.id
channel_id = newrelic_alert_channel.victorops_urgent.0.id
}