forked from oracle-terraform-modules/terraform-oci-logging
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
378 lines (269 loc) · 11.3 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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
#Copyright (c) 2021, 2023 Oracle Corporation and/or its affiliates.
#Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl
#Analytics Cloud loggroup resource
resource "oci_logging_log_group" "analyticscloudloggroup" {
for_each = toset(local.analyticscloudloggroup)
compartment_id = var.compartment_id
description = "Oracle Analytics Cloud Loggroup"
display_name = var.label_prefix == "none" ? each.value : format("%s-%s", var.label_prefix, each.value)
freeform_tags = var.loggroup_tags
}
#APIGateway loggroup resource
resource "oci_logging_log_group" "apigwloggroup" {
for_each = toset(local.apigwloggroup)
compartment_id = var.compartment_id
description = "API Gateway Loggroup"
display_name = var.label_prefix == "none" ? each.value : format("%s-%s", var.label_prefix, each.value)
freeform_tags = var.loggroup_tags
}
#APM loggroup resource
resource "oci_logging_log_group" "apmloggroup" {
for_each = toset(local.apmloggroup)
compartment_id = var.compartment_id
description = "APM Loggroup"
display_name = var.label_prefix == "none" ? each.value : format("%s-%s", var.label_prefix, each.value)
freeform_tags = var.loggroup_tags
}
#Devops loggroup
resource "oci_logging_log_group" "devopsloggroup" {
for_each = toset(local.devopsloggroup)
compartment_id = var.compartment_id
description = "Devops Loggroup"
display_name = var.label_prefix == "none" ? each.value : format("%s-%s", var.label_prefix, each.value)
freeform_tags = var.loggroup_tags
}
#Email delivery loggroup resource
resource "oci_logging_log_group" "emailloggroup" {
for_each = toset(local.emailloggroup)
compartment_id = var.compartment_id
description = "Email Delivery Loggroup"
display_name = var.label_prefix == "none" ? each.value : format("%s-%s", var.label_prefix, each.value)
freeform_tags = var.loggroup_tags
}
#Event Service loggroup resource
resource "oci_logging_log_group" "eventloggroup" {
for_each = toset(local.eventloggroup)
compartment_id = var.compartment_id
description = "Events Loggroup"
display_name = var.label_prefix == "none" ? each.value : format("%s-%s", var.label_prefix, each.value)
freeform_tags = var.loggroup_tags
}
#Function loggroup resource
resource "oci_logging_log_group" "funcloggroup" {
for_each = toset(local.funcloggroup)
compartment_id = var.compartment_id
description = "Functions Loggroup"
display_name = var.label_prefix == "none" ? each.value : format("%s-%s", var.label_prefix, each.value)
freeform_tags = var.loggroup_tags
}
#Integration loggroup resource
resource "oci_logging_log_group" "intloggroup" {
for_each = toset(local.intloggroup)
compartment_id = var.compartment_id
description = "Integration Loggroup"
display_name = var.label_prefix == "none" ? each.value : format("%s-%s", var.label_prefix, each.value)
freeform_tags = var.loggroup_tags
}
#Loadbalancer loggroup resource
resource "oci_logging_log_group" "lbloggroup" {
for_each = toset(local.lbloggroup)
compartment_id = var.compartment_id
description = "Loadbalancer Loggroup"
display_name = var.label_prefix == "none" ? each.value : format("%s-%s", var.label_prefix, each.value)
freeform_tags = var.loggroup_tags
}
#Mediaflow loggroup resource
resource "oci_logging_log_group" "medialoggroup" {
for_each = toset(local.medialoggroup)
compartment_id = var.compartment_id
description = "Mediaflow Loggroup"
display_name = var.label_prefix == "none" ? each.value : format("%s-%s", var.label_prefix, each.value)
freeform_tags = var.loggroup_tags
}
#ObjectStorage loggroup resource
resource "oci_logging_log_group" "osloggroup" {
for_each = toset(local.osloggroup)
compartment_id = var.compartment_id
description = "ObjectStorage Loggroup"
display_name = var.label_prefix == "none" ? each.value : format("%s-%s", var.label_prefix, each.value)
freeform_tags = var.loggroup_tags
}
#VCN loggroup resource
resource "oci_logging_log_group" "vcnloggroup" {
for_each = toset(local.vcnloggroup)
compartment_id = var.compartment_id
description = "VCN flowlogs Loggroup"
display_name = var.label_prefix == "none" ? each.value : format("%s-%s", var.label_prefix, each.value)
freeform_tags = var.loggroup_tags
}
#VPN loggroup resource
resource "oci_logging_log_group" "vpnloggroup" {
for_each = toset(local.vpnloggroup)
compartment_id = var.compartment_id
description = "VPN IPSEC Loggroup"
display_name = var.label_prefix == "none" ? each.value : format("%s-%s", var.label_prefix, each.value)
freeform_tags = var.loggroup_tags
}
#WAF loggroup resource
resource "oci_logging_log_group" "wafloggroup" {
for_each = toset(local.wafloggroup)
compartment_id = var.compartment_id
description = "WAF Loggroup"
display_name = var.label_prefix == "none" ? each.value : format("%s-%s", var.label_prefix, each.value)
freeform_tags = var.loggroup_tags
}
#Custom Linux loggroup resource
resource "oci_logging_log_group" "linuxloggroup" {
for_each = toset(local.linuxloggroup)
compartment_id = var.compartment_id
display_name = var.label_prefix == "none" ? each.value : format("%s-%s", var.label_prefix, each.value)
description = "Custom Linux logs loggroup"
freeform_tags = var.loggroup_tags
}
#Custom windows loggroup resource
resource "oci_logging_log_group" "winloggroup" {
for_each = toset(local.winloggroup)
compartment_id = var.compartment_id
display_name = var.label_prefix == "none" ? each.value : format("%s-%s", var.label_prefix, each.value)
description = "Custom Windows logs loggroup"
freeform_tags = var.loggroup_tags
}
module "apigwlog" {
source = "./modules/apigateway"
compartment_id = var.compartment_id
label_prefix = var.label_prefix
logdefinition = local.apigwlogdef
log_retention_duration = var.log_retention_duration
loggroup = oci_logging_log_group.apigwloggroup
count = length(local.apigwlogdef) >= 1 ? 1 : 0
}
module "apmlog" {
source = "./modules/apm"
compartment_id = var.compartment_id
label_prefix = var.label_prefix
logdefinition = local.apmlogdef
log_retention_duration = var.log_retention_duration
loggroup = oci_logging_log_group.apmloggroup
count = length(local.apmlogdef) >= 1 ? 1 : 0
}
module "customlog" {
source = "./modules/custom"
compartment_id = var.compartment_id
label_prefix = var.label_prefix
linux_logdef = var.linux_logdef
windows_logdef = var.windows_logdef
log_retention_duration = var.log_retention_duration
tenancy_id = var.tenancy_id
linuxloggroup = oci_logging_log_group.linuxloggroup
winloggroup = oci_logging_log_group.winloggroup
count = (length(var.linux_logdef)) >= 1 || (length(var.windows_logdef)) >= 1 ? 1 : 0
}
module "devopslog" {
source = "./modules/devops"
compartment_id = var.compartment_id
label_prefix = var.label_prefix
logdefinition = local.devopslogdef
log_retention_duration = var.log_retention_duration
loggroup = oci_logging_log_group.devopsloggroup
count = length(local.devopslogdef) >= 1 ? 1 : 0
}
module "emaillog" {
source = "./modules/emaildelivery"
compartment_id = var.compartment_id
label_prefix = var.label_prefix
logdefinition = local.emaillogdef
log_retention_duration = var.log_retention_duration
loggroup = oci_logging_log_group.emailloggroup
count = length(local.emaillogdef) >= 1 ? 1 : 0
}
module "eventlog" {
source = "./modules/event"
compartment_id = var.compartment_id
label_prefix = var.label_prefix
logdefinition = local.eventlogdef
log_retention_duration = var.log_retention_duration
loggroup = oci_logging_log_group.eventloggroup
count = length(local.eventlogdef) >= 1 ? 1 : 0
}
module "funclog" {
source = "./modules/function"
compartment_id = var.compartment_id
label_prefix = var.label_prefix
logdefinition = local.funclogdef
log_retention_duration = var.log_retention_duration
loggroup = oci_logging_log_group.funcloggroup
count = length(local.funclogdef) >= 1 ? 1 : 0
}
module "intlog" {
source = "./modules/integration"
compartment_id = var.compartment_id
label_prefix = var.label_prefix
logdefinition = local.intlogdef
log_retention_duration = var.log_retention_duration
loggroup = oci_logging_log_group.intloggroup
count = length(local.intlogdef) >= 1 ? 1 : 0
}
module "lblog" {
source = "./modules/lb"
compartment_id = var.compartment_id
label_prefix = var.label_prefix
logdefinition = local.lblogdef
log_retention_duration = var.log_retention_duration
loggroup = oci_logging_log_group.lbloggroup
count = length(local.lblogdef) >= 1 ? 1 : 0
}
module "mediaflowlog" {
source = "./modules/mediaflow"
compartment_id = var.compartment_id
label_prefix = var.label_prefix
logdefinition = local.medialogdef
log_retention_duration = var.log_retention_duration
loggroup = oci_logging_log_group.medialoggroup
count = length(local.medialogdef) >= 1 ? 1 : 0
}
module "analyticscloudlog" {
source = "./modules/analyticscloud"
compartment_id = var.compartment_id
label_prefix = var.label_prefix
logdefinition = local.analyticscloudlogdef
log_retention_duration = var.log_retention_duration
loggroup = oci_logging_log_group.analyticscloudloggroup
count = length(local.analyticscloudlogdef) >= 1 ? 1 : 0
}
module "objectstorelog" {
source = "./modules/objectstorage"
compartment_id = var.compartment_id
label_prefix = var.label_prefix
logdefinition = local.oslogdef
log_retention_duration = var.log_retention_duration
loggroup = oci_logging_log_group.osloggroup
count = length(local.oslogdef) >= 1 ? 1 : 0
}
module "vcnlog" {
source = "./modules/vcn"
compartment_id = var.compartment_id
label_prefix = var.label_prefix
logdefinition = local.vcnlogdef
log_retention_duration = var.log_retention_duration
loggroup = oci_logging_log_group.vcnloggroup
vcn_id = var.vcn_id
count = length(local.vcnlogdef) >= 1 ? 1 : 0
}
module "vpnlog" {
source = "./modules/vpn"
compartment_id = var.compartment_id
label_prefix = var.label_prefix
logdefinition = local.vpnlogdef
log_retention_duration = var.log_retention_duration
loggroup = oci_logging_log_group.vpnloggroup
count = length(local.vpnlogdef) >= 1 ? 1 : 0
}
module "waflog" {
source = "./modules/waf"
compartment_id = var.compartment_id
label_prefix = var.label_prefix
logdefinition = local.waflogdef
log_retention_duration = var.log_retention_duration
loggroup = oci_logging_log_group.wafloggroup
count = length(local.waflogdef) >= 1 ? 1 : 0
}