generated from cloudposse/terraform-example-module
-
-
Notifications
You must be signed in to change notification settings - Fork 22
/
main.tf
49 lines (40 loc) · 1.76 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
resource "opsgenie_alert_policy" "this" {
count = module.this.enabled ? 1 : 0
name = var.alert_policy.name
policy_description = try(var.alert_policy.description, var.alert_policy.name)
team_id = try(var.alert_policy.team_id, null)
enabled = try(var.alert_policy.enabled, true)
continue_policy = try(var.alert_policy.continue, true)
alias = try(var.alert_policy.alias, null)
entity = try(var.alert_policy.entity, null)
message = try(var.alert_policy.message, "{{ message }}")
priority = try(var.alert_policy.priority, null)
source = try(var.alert_policy.source, null)
tags = try(var.alert_policy.tags, null)
ignore_original_actions = try(var.alert_policy.ignore_original_actions, false)
ignore_original_details = try(var.alert_policy.ignore_original_details, false)
ignore_original_responders = try(var.alert_policy.ignore_original_responders, false)
ignore_original_tags = try(var.alert_policy.ignore_original_tags, false)
dynamic "responders" {
for_each = try(var.alert_policy.responders, [])
content {
id = responders.value.id
name = try(responders.value.name, null)
type = responders.value.type
username = try(responders.value.username, null)
}
}
filter {
type = try(var.alert_policy.filter.type, "match-all")
dynamic "conditions" {
for_each = try(var.alert_policy.filter.conditions, [])
content {
expected_value = try(conditions.value.expected_value, null)
field = try(conditions.value.field, null)
key = try(conditions.value.key, null)
not = try(conditions.value.not, null)
operation = try(conditions.value.operation, null)
}
}
}
}