-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.tf
33 lines (27 loc) · 1.4 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_service_incident_rule" "this" {
count = module.this.enabled ? 1 : 0
service_id = var.service_incident_rule.service_id
incident_rule {
condition_match_type = try(var.service_incident_rule.incident_rule.condition_match_type, "match-all")
dynamic "conditions" {
for_each = try(var.service_incident_rule.incident_rule.conditions, [])
content {
expected_value = try(conditions.value.expected_value, null)
field = conditions.value.field
not = try(conditions.value.not, null)
operation = conditions.value.operation
}
}
incident_properties {
message = var.service_incident_rule.incident_rule.incident_properties.message
priority = var.service_incident_rule.incident_rule.incident_properties.priority
tags = try(var.service_incident_rule.incident_rule.incident_properties.tags, null)
details = try(var.service_incident_rule.incident_rule.incident_properties.details, null)
stakeholder_properties {
message = var.service_incident_rule.incident_rule.incident_properties.stakeholder_properties.message
description = try(var.service_incident_rule.incident_rule.incident_properties.stakeholder_properties.description, null)
enable = try(var.service_incident_rule.incident_rule.incident_properties.stakeholder_properties.enable, null)
}
}
}
}