generated from cloudposse/terraform-example-module
-
-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathservice_incident_rules.tf
33 lines (27 loc) · 1.4 KB
/
service_incident_rules.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" {
for_each = module.this.enabled ? { for service_incident_rule in local.service_incident_rules : service_incident_rule.name => service_incident_rule } : tomap()
service_id = opsgenie_service.this[each.value.service_name].id
incident_rule {
condition_match_type = try(each.value.incident_rule.condition_match_type, "match-all")
dynamic "conditions" {
for_each = try(each.value.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 = each.value.incident_rule.incident_properties.message
priority = each.value.incident_rule.incident_properties.priority
tags = try(each.value.incident_rule.incident_properties.tags, null)
details = try(each.value.incident_rule.incident_properties.details, null)
stakeholder_properties {
message = each.value.incident_rule.incident_properties.stakeholder_properties.message
description = try(each.value.incident_rule.incident_properties.stakeholder_properties.description, null)
enable = try(each.value.incident_rule.incident_properties.stakeholder_properties.enable, null)
}
}
}
}