generated from libre-devops/terraform-module-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
237 lines (210 loc) · 9.13 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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
resource "azurerm_eventgrid_system_topic_event_subscription" "event_subscription" {
for_each = { for k, v in var.eventgrid_system_event_subscriptions : k => v }
name = each.value.name
system_topic = each.value.system_topic_name
resource_group_name = each.value.rg_name
expiration_time_utc = each.value.expiration_time_utc
event_delivery_schema = each.value.event_delivery_schema
advanced_filtering_on_arrays_enabled = each.value.advanced_filtering_on_arrays_enabled
labels = each.value.labels
eventhub_endpoint_id = each.value.eventhub_endpoint_id
hybrid_connection_endpoint_id = each.value.hybrid_connection_endpoint_id
service_bus_queue_endpoint_id = each.value.service_bus_queue_endpoint_id
service_bus_topic_endpoint_id = each.value.service_bus_topic_endpoint_id
included_event_types = each.value.included_event_types
dynamic "storage_queue_endpoint" {
for_each = each.value.storage_queue_endpoint != null ? [each.value.storage_queue_endpoint] : []
content {
storage_account_id = storage_queue_endpoint.value.storage_account_id
queue_name = storage_queue_endpoint.value.queue_name
queue_message_time_to_live_in_seconds = storage_queue_endpoint.value.queue_message_time_to_live_in_seconds
}
}
dynamic "azure_function_endpoint" {
for_each = each.value.azure_function_endpoint != null ? [each.value.azure_function_endpoint] : []
content {
function_id = azure_function_endpoint.value.function_id
max_events_per_batch = azure_function_endpoint.value.max_events_per_batch
preferred_batch_size_in_kilobytes = azure_function_endpoint.value.preferred_batch_size_in_kilobytes
}
}
dynamic "webhook_endpoint" {
for_each = each.value.webhook_endpoint != null ? [each.value.webhook_endpoint] : []
content {
url = webhook_endpoint.value.url
max_events_per_batch = webhook_endpoint.value.max_events_per_batch
preferred_batch_size_in_kilobytes = webhook_endpoint.value.preferred_batch_size_in_kilobytes
active_directory_tenant_id = webhook_endpoint.value.active_directory_tenant_id
active_directory_app_id_or_uri = webhook_endpoint.value.active_directory_app_id_or_uri
}
}
dynamic "subject_filter" {
for_each = each.value.subject_filter != null ? [each.value.subject_filter] : []
content {
subject_begins_with = subject_filter.value.subject_begins_with
subject_ends_with = subject_filter.value.subject_ends_with
case_sensitive = subject_filter.value.case_sensitive
}
}
dynamic "dead_letter_identity" {
for_each = each.value.dead_letter_identity != null ? [each.value.dead_letter_identity] : []
content {
type = dead_letter_identity.value.type
user_assigned_identity = dead_letter_identity.value.user_assigned_identity
}
}
// Handling the storage_blob_dead_letter_destination
dynamic "storage_blob_dead_letter_destination" {
for_each = each.value.storage_blob_dead_letter_destination != null ? [
each.value.storage_blob_dead_letter_destination
] : []
content {
storage_account_id = storage_blob_dead_letter_destination.value.storage_account_id
storage_blob_container_name = storage_blob_dead_letter_destination.value.storage_blob_container_name
}
}
// Handling the retry_policy
dynamic "retry_policy" {
for_each = each.value.retry_policy != null ? [each.value.retry_policy] : []
content {
max_delivery_attempts = retry_policy.value.max_delivery_attempts
event_time_to_live = retry_policy.value.event_time_to_live
}
}
dynamic "advanced_filter" {
for_each = each.value.advanced_filters != null ? [each.value.advanced_filters] : []
content {
dynamic "bool_equals" {
for_each = advanced_filter.value.bool_equals != null ? advanced_filter.value.bool_equals : []
content {
key = bool_equals.value.key
value = bool_equals.value.value
}
}
dynamic "number_greater_than" {
for_each = advanced_filter.value.number_greater_than != null ? advanced_filter.value.number_greater_than : []
content {
key = number_greater_than.value.key
value = number_greater_than.value.value
}
}
dynamic "number_greater_than_or_equals" {
for_each = advanced_filter.value.number_greater_than_or_equals != null ? advanced_filter.value.number_greater_than_or_equals : []
content {
key = number_greater_than_or_equals.value.key
value = number_greater_than_or_equals.value.value
}
}
dynamic "number_less_than" {
for_each = advanced_filter.value.number_less_than != null ? advanced_filter.value.number_less_than : []
content {
key = number_less_than.value.key
value = number_less_than.value.value
}
}
dynamic "number_less_than_or_equals" {
for_each = advanced_filter.value.number_less_than_or_equals != null ? advanced_filter.value.number_less_than_or_equals : []
content {
key = number_less_than_or_equals.value.key
value = number_less_than_or_equals.value.value
}
}
dynamic "number_in" {
for_each = advanced_filter.value.number_in != null ? advanced_filter.value.number_in : []
content {
key = number_in.value.key
values = number_in.value.values
}
}
dynamic "number_not_in" {
for_each = advanced_filter.value.number_not_in != null ? advanced_filter.value.number_not_in : []
content {
key = number_not_in.value.key
values = number_not_in.value.values
}
}
dynamic "number_in_range" {
for_each = advanced_filter.value.number_in_range != null ? advanced_filter.value.number_in_range : []
content {
key = number_in_range.value.key
values = number_in_range.value.values
}
}
dynamic "number_not_in_range" {
for_each = advanced_filter.value.number_not_in_range != null ? advanced_filter.value.number_not_in_range : []
content {
key = number_not_in_range.value.key
values = number_not_in_range.value.values
}
}
dynamic "string_begins_with" {
for_each = advanced_filter.value.string_begins_with != null ? advanced_filter.value.string_begins_with : []
content {
key = string_begins_with.value.key
values = string_begins_with.value.values
}
}
dynamic "string_not_begins_with" {
for_each = advanced_filter.value.string_not_begins_with != null ? advanced_filter.value.string_not_begins_with : []
content {
key = string_not_begins_with.value.key
values = string_not_begins_with.value.values
}
}
dynamic "string_ends_with" {
for_each = advanced_filter.value.string_ends_with != null ? advanced_filter.value.string_ends_with : []
content {
key = string_ends_with.value.key
values = string_ends_with.value.values
}
}
dynamic "string_not_ends_with" {
for_each = advanced_filter.value.string_not_ends_with != null ? advanced_filter.value.string_not_ends_with : []
content {
key = string_not_ends_with.value.key
values = string_not_ends_with.value.values
}
}
dynamic "string_contains" {
for_each = advanced_filter.value.string_contains != null ? advanced_filter.value.string_contains : []
content {
key = string_contains.value.key
values = string_contains.value.values
}
}
dynamic "string_not_contains" {
for_each = advanced_filter.value.string_not_contains != null ? advanced_filter.value.string_not_contains : []
content {
key = string_not_contains.value.key
values = string_not_contains.value.values
}
}
dynamic "string_in" {
for_each = advanced_filter.value.string_in != null ? advanced_filter.value.string_in : []
content {
key = string_in.value.key
values = string_in.value.values
}
}
dynamic "string_not_in" {
for_each = advanced_filter.value.string_not_in != null ? advanced_filter.value.string_not_in : []
content {
key = string_not_in.value.key
values = string_not_in.value.values
}
}
dynamic "is_not_null" {
for_each = advanced_filter.value.is_not_null != null ? advanced_filter.value.is_not_null : []
content {
key = is_not_null.value.key
}
}
dynamic "is_null_or_undefined" {
for_each = advanced_filter.value.is_null_or_undefined != null ? advanced_filter.value.is_null_or_undefined : []
content {
key = is_null_or_undefined.value.key
}
}
}
}
}