generated from cloudposse/terraform-example-module
-
-
Notifications
You must be signed in to change notification settings - Fork 22
/
main.tf
147 lines (120 loc) · 4.68 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
resource "opsgenie_integration_action" "this" {
count = module.this.enabled ? 1 : 0
integration_id = var.integration_action.integration_id
dynamic "create" {
for_each = try(var.integration_action.create, [])
content {
name = try(create.value.name, null)
order = try(create.value.order, null)
tags = try(create.value.tags, [])
user = try(create.value.user, null)
note = try(create.value.note, null)
alias = try(create.value.alias, null)
source = try(create.value.source, null)
message = try(create.value.message, null)
description = try(create.value.description, null)
entity = try(create.value.entity, null)
alert_actions = try(create.value.alert_actions, [])
extra_properties = try(create.value.extra_properties, {})
custom_priority = try(create.value.custom_priority, null)
ignore_responders_from_payload = try(create.value.ignore_responders_from_payload, false)
ignore_teams_from_payload = try(create.value.ignore_teams_from_payload, false)
responders {
id = var.integration_action.team_id
type = "team"
}
filter {
type = try(create.value.filter.type, null)
dynamic "conditions" {
for_each = try(create.value.filter.conditions, [])
content {
field = try(conditions.value.field, null)
not = try(conditions.value.not, null)
operation = try(conditions.value.operation, null)
expected_value = try(conditions.value.expected_value, null)
}
}
}
}
}
dynamic "close" {
for_each = try(var.integration_action.close, [])
content {
name = try(close.value.name, null)
order = try(close.value.order, null)
alias = try(close.value.alias, null)
filter {
type = try(close.value.filter.type, null)
dynamic "conditions" {
for_each = try(close.value.filter.conditions, [])
content {
field = try(conditions.value.field, null)
not = try(conditions.value.not, null)
operation = try(conditions.value.operation, null)
expected_value = try(conditions.value.expected_value, null)
}
}
}
}
}
dynamic "acknowledge" {
for_each = try(var.integration_action.acknowledge, [])
content {
name = try(acknowledge.value.name, null)
order = try(acknowledge.value.order, null)
alias = try(acknowledge.value.alias, null)
filter {
type = try(acknowledge.value.filter.type, null)
dynamic "conditions" {
for_each = try(acknowledge.value.filter.conditions, [])
content {
field = try(conditions.value.field, null)
not = try(conditions.value.not, null)
operation = try(conditions.value.operation, null)
expected_value = try(conditions.value.expected_value, null)
}
}
}
}
}
dynamic "add_note" {
for_each = try(var.integration_action.add_note, [])
content {
name = try(add_note.value.name, null)
order = try(add_note.value.order, null)
alias = try(add_note.value.alias, null)
note = try(add_note.value.name, null)
filter {
type = try(add_note.value.filter.type, null)
dynamic "conditions" {
for_each = try(add_note.value.filter.conditions, [])
content {
field = try(conditions.value.field, null)
not = try(conditions.value.not, null)
operation = try(conditions.value.operation, null)
expected_value = try(conditions.value.expected_value, null)
}
}
}
}
}
dynamic "ignore" {
for_each = try(var.integration_action.ignore, [])
content {
name = try(ignore.value.name, null)
order = try(ignore.value.order, null)
filter {
type = try(ignore.value.filter.type, null)
dynamic "conditions" {
for_each = try(ignore.value.filter.conditions, [])
content {
field = try(conditions.value.field, null)
not = try(conditions.value.not, null)
operation = try(conditions.value.operation, null)
expected_value = try(conditions.value.expected_value, null)
}
}
}
}
}
}