generated from cloudposse/terraform-example-module
-
-
Notifications
You must be signed in to change notification settings - Fork 22
/
main.tf
33 lines (27 loc) · 1.03 KB
/
main.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
resource "opsgenie_escalation" "this" {
count = module.this.enabled ? 1 : 0
name = var.escalation.name
description = try(var.escalation.description, var.escalation.name)
owner_team_id = try(var.escalation.owner_team_id, null)
dynamic "rules" {
for_each = var.escalation.rules
content {
condition = try(rules.value.condition, "if-not-acked")
notify_type = try(rules.value.notify_type, "default")
delay = try(rules.value.delay, 0)
recipient {
type = rules.value.recipient.type
id = try(rules.value.recipient.id, null)
}
}
}
dynamic "repeat" {
for_each = try(var.escalation.repeat, null) != null ? ["true"] : []
content {
wait_interval = try(var.escalation.repeat.wait_interval, 5)
count = try(var.escalation.repeat.count, 0)
reset_recipient_states = try(var.escalation.repeat.reset_recipient_states, true)
close_alert_after_all = try(var.escalation.repeat.close_alert_after_all, true)
}
}
}