generated from oracle/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 2
/
iam_groups.tf
435 lines (386 loc) · 32.2 KB
/
iam_groups.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
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
# Copyright (c) 2023 Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
### This Terraform configuration provisions Landing Zone groups.
locals {
#------------------------------------------------------------------------------------------------------
#-- Any of these local variables can be overriden in a _override.tf file
#------------------------------------------------------------------------------------------------------
custom_groups_defined_tags = null
custom_groups_freeform_tags = null
custom_iam_admin_group_name = null
custom_cred_admin_group_name = null
custom_cost_admin_group_name = null
custom_network_admin_group_name = null
custom_security_admin_group_name = null
custom_appdev_admin_group_name = null
custom_database_admin_group_name = null
custom_exainfra_admin_group_name = null
custom_storage_admin_group_name = null
custom_auditor_group_name = null
custom_announcement_reader_group_name = null
custom_ag_admin_group_name = null
}
module "lz_groups" {
source = "github.com/oci-landing-zones/terraform-oci-modules-iam//groups?ref=v0.2.4"
providers = { oci = oci.home }
tenancy_ocid = var.tenancy_ocid
groups_configuration = var.extend_landing_zone_to_new_region == false && var.use_custom_id_domain == false ? local.groups_configuration : local.empty_groups_configuration
}
module "lz_custom_domain_groups" {
source = "github.com/oci-landing-zones/terraform-oci-modules-iam//identity-domains?ref=v0.2.4"
count = var.deploy_custom_domain_groups ? 1 : 0
providers = { oci = oci.home }
tenancy_ocid = var.tenancy_ocid
identity_domain_groups_configuration = var.extend_landing_zone_to_new_region == false && var.use_custom_id_domain == true ? local.custom_domain_groups_configuration : local.empty_groups_configuration
}
locals {
#------------------------------------------------------------------------------------------------------
#-- These variables are not meant to be overriden
#------------------------------------------------------------------------------------------------------
#-----------------------------------------------------------
#----- Tags to apply to groups
#-----------------------------------------------------------
default_groups_defined_tags = null
default_groups_freeform_tags = local.landing_zone_tags
groups_defined_tags = local.custom_groups_defined_tags != null ? merge(local.custom_groups_defined_tags, local.default_groups_defined_tags) : local.default_groups_defined_tags
groups_freeform_tags = local.custom_groups_freeform_tags != null ? merge(local.custom_groups_freeform_tags, local.default_groups_freeform_tags) : local.default_groups_freeform_tags
#--------------------------------------------------------------------
#-- IAM Identity Domain
#--------------------------------------------------------------------
custom_id_domain_name = var.use_custom_id_domain == true ? data.oci_identity_domain.existing_identity_domain[0].display_name : null
#--------------------------------------------------------------------
#-- IAM Admin
#--------------------------------------------------------------------
iam_admin_group_key = "IAM-ADMIN-GROUP"
default_iam_admin_group_name = "iam-admin-group"
provided_iam_admin_group_name = coalesce(local.custom_iam_admin_group_name, "${var.service_label}-${local.default_iam_admin_group_name}")
iam_admin_group = length(var.existing_iam_admin_group_name) == 0 && length(trimspace(var.rm_existing_iam_admin_group_name)) == 0 ? {
(local.iam_admin_group_key) = {
name = local.provided_iam_admin_group_name
description = "Landing Zone group for managing IAM resources in the tenancy."
members = []
defined_tags = local.groups_defined_tags
freeform_tags = local.groups_freeform_tags
}
} : {}
custom_domain_iam_admin_group = var.deploy_custom_domain_groups ? {
(local.iam_admin_group_key) = {
identity_domain_id = trimspace(var.custom_id_domain_ocid)
name = local.provided_iam_admin_group_name
description = "Landing Zone group for managing IAM resources in the tenancy."
members = []
defined_tags = local.groups_defined_tags
freeform_tags = local.groups_freeform_tags
}
} : {}
#--------------------------------------------------------------------
#-- Credentials Admin
#--------------------------------------------------------------------
cred_admin_group_key = "CRED-ADMIN-GROUP"
default_cred_admin_group_name = "cred-admin-group"
provided_cred_admin_group_name = coalesce(local.custom_cred_admin_group_name, "${var.service_label}-${local.default_cred_admin_group_name}")
cred_admin_group = length(var.existing_cred_admin_group_name) == 0 && length(trimspace(var.rm_existing_cred_admin_group_name)) == 0 ? {
(local.cred_admin_group_key) = {
name = local.provided_cred_admin_group_name
description = "Landing Zone group for managing users credentials in the tenancy."
members = []
defined_tags = local.groups_defined_tags
freeform_tags = local.groups_freeform_tags
}
} : {}
custom_domain_cred_admin_group = var.deploy_custom_domain_groups ? {
(local.cred_admin_group_key) = {
identity_domain_id = trimspace(var.custom_id_domain_ocid)
name = local.provided_cred_admin_group_name
description = "Landing Zone group for managing users credentials in the tenancy."
members = []
defined_tags = local.groups_defined_tags
freeform_tags = local.groups_freeform_tags
}
} : {}
#--------------------------------------------------------------------
#-- Cost Admin
#--------------------------------------------------------------------
cost_admin_group_key = "COST-ADMIN-GROUP"
default_cost_admin_group_name = "cost-admin-group"
provided_cost_admin_group_name = coalesce(local.custom_cost_admin_group_name, "${var.service_label}-${local.default_cost_admin_group_name}")
cost_admin_group = length(var.existing_cost_admin_group_name) == 0 && length(trimspace(var.rm_existing_cost_admin_group_name)) == 0 ? {
(local.cost_admin_group_key) = {
name = local.provided_cost_admin_group_name
description = "Landing Zone group for Cost management."
members = []
defined_tags = local.groups_defined_tags
freeform_tags = local.groups_freeform_tags
}
} : {}
custom_domain_cost_admin_group = var.deploy_custom_domain_groups ? {
(local.cost_admin_group_key) = {
identity_domain_id = trimspace(var.custom_id_domain_ocid)
name = local.provided_cost_admin_group_name
description = "Landing Zone group for Cost management."
members = []
defined_tags = local.groups_defined_tags
freeform_tags = local.groups_freeform_tags
}
} : {}
#--------------------------------------------------------------------
#-- Network Admin
#--------------------------------------------------------------------
network_admin_group_key = "NETWORK-ADMIN-GROUP"
default_network_admin_group_name = "network-admin-group"
provided_network_admin_group_name = coalesce(local.custom_network_admin_group_name, "${var.service_label}-${local.default_network_admin_group_name}")
network_admin_group = length(var.existing_network_admin_group_name) == 0 && length(trimspace(var.rm_existing_network_admin_group_name)) == 0 ? {
(local.network_admin_group_key) = {
name = local.provided_network_admin_group_name
description = "Landing Zone group for network management."
members = []
defined_tags = local.groups_defined_tags
freeform_tags = local.groups_freeform_tags
}
} : {}
custom_domain_network_admin_group = var.deploy_custom_domain_groups ? {
(local.network_admin_group_key) = {
identity_domain_id = trimspace(var.custom_id_domain_ocid)
name = local.provided_network_admin_group_name
description = "Landing Zone group for network management."
members = []
defined_tags = local.groups_defined_tags
freeform_tags = local.groups_freeform_tags
}
} : {}
#--------------------------------------------------------------------
#-- Security Admin
#--------------------------------------------------------------------
security_admin_group_key = "SECURITY-ADMIN-GROUP"
default_security_admin_group_name = "security-admin-group"
provided_security_admin_group_name = coalesce(local.custom_security_admin_group_name, "${var.service_label}-${local.default_security_admin_group_name}")
security_admin_group = length(var.existing_security_admin_group_name) == 0 && length(trimspace(var.rm_existing_security_admin_group_name)) == 0 ? {
(local.security_admin_group_key) = {
name = local.provided_security_admin_group_name
description = "Landing Zone group for security services management."
members = []
defined_tags = local.groups_defined_tags
freeform_tags = local.groups_freeform_tags
}
} : {}
custom_domain_security_admin_group = var.deploy_custom_domain_groups ? {
(local.security_admin_group_key) = {
identity_domain_id = trimspace(var.custom_id_domain_ocid)
name = local.provided_security_admin_group_name
description = "Landing Zone group for security services management."
members = []
defined_tags = local.groups_defined_tags
freeform_tags = local.groups_freeform_tags
}
} : {}
#--------------------------------------------------------------------
#-- AppDev Admin
#--------------------------------------------------------------------
appdev_admin_group_key = "APP-ADMIN-GROUP"
default_appdev_admin_group_name = "app-admin-group"
provided_appdev_admin_group_name = coalesce(local.custom_appdev_admin_group_name, "${var.service_label}-${local.default_appdev_admin_group_name}")
appdev_admin_group = length(var.existing_appdev_admin_group_name) == 0 && length(trimspace(var.rm_existing_appdev_admin_group_name)) == 0 ? {
(local.appdev_admin_group_key) = {
name = local.provided_appdev_admin_group_name
description = "Landing Zone group for managing app development related services."
members = []
defined_tags = local.groups_defined_tags
freeform_tags = local.groups_freeform_tags
}
} : {}
custom_domain_appdev_admin_group = var.deploy_custom_domain_groups ? {
(local.appdev_admin_group_key) = {
identity_domain_id = trimspace(var.custom_id_domain_ocid)
name = local.provided_appdev_admin_group_name
description = "Landing Zone group for managing app development related services."
members = []
defined_tags = local.groups_defined_tags
freeform_tags = local.groups_freeform_tags
}
} : {}
#--------------------------------------------------------------------
#-- Database Admin
#--------------------------------------------------------------------
database_admin_group_key = "DATABASE-ADMIN-GROUP"
default_database_admin_group_name = "database-admin-group"
provided_database_admin_group_name = coalesce(local.custom_database_admin_group_name, "${var.service_label}-${local.default_database_admin_group_name}")
database_admin_group = length(var.existing_database_admin_group_name) == 0 && length(trimspace(var.rm_existing_database_admin_group_name)) == 0 ? {
(local.database_admin_group_key) = {
name = local.provided_database_admin_group_name
description = "Landing Zone group for managing databases."
members = []
defined_tags = local.groups_defined_tags
freeform_tags = local.groups_freeform_tags
}
} : {}
custom_domain_database_admin_group = var.deploy_custom_domain_groups ? {
(local.database_admin_group_key) = {
identity_domain_id = trimspace(var.custom_id_domain_ocid)
name = local.provided_database_admin_group_name
description = "Landing Zone group for managing databases."
members = []
defined_tags = local.groups_defined_tags
freeform_tags = local.groups_freeform_tags
}
} : {}
#--------------------------------------------------------------------
#-- Exainfra Admin
#--------------------------------------------------------------------
exainfra_admin_group_key = "EXAINFRA-ADMIN-GROUP"
default_exainfra_admin_group_name = "exainfra-admin-group"
provided_exainfra_admin_group_name = coalesce(local.custom_exainfra_admin_group_name, "${var.service_label}-${local.default_exainfra_admin_group_name}")
exainfra_admin_group = var.deploy_exainfra_cmp == true && length(var.existing_exainfra_admin_group_name) == 0 && length(trimspace(var.rm_existing_exainfra_admin_group_name)) == 0 ? {
(local.exainfra_admin_group_key) = {
name = local.provided_exainfra_admin_group_name
description = "Landing Zone group for managing Exadata Cloud Service infrastructure."
members = []
defined_tags = local.groups_defined_tags
freeform_tags = local.groups_freeform_tags
}
} : {}
custom_domain_exainfra_admin_group = var.deploy_exainfra_cmp == true && var.deploy_custom_domain_groups ? {
(local.exainfra_admin_group_key) = {
identity_domain_id = trimspace(var.custom_id_domain_ocid)
name = local.provided_exainfra_admin_group_name
description = "Landing Zone group for managing Exadata Cloud Service infrastructure."
members = []
defined_tags = local.groups_defined_tags
freeform_tags = local.groups_freeform_tags
}
} : {}
#------------------------------------------------------------------------
#-- Storage admin
#------------------------------------------------------------------------
storage_admin_group_key = "STORAGE-ADMIN-GROUP"
default_storage_admin_group_name = "storage-admin-group"
provided_storage_admin_group_name = coalesce(local.custom_storage_admin_group_name, "${var.service_label}-${local.default_storage_admin_group_name}")
storage_admin_group = length(var.existing_storage_admin_group_name) == 0 && length(trimspace(var.rm_existing_storage_admin_group_name)) == 0 ? {
(local.storage_admin_group_key) = {
name = local.provided_storage_admin_group_name
description = "Landing Zone group for storage services management."
members = []
defined_tags = local.groups_defined_tags
freeform_tags = local.groups_freeform_tags
}
} : {}
custom_domain_storage_admin_group = var.deploy_custom_domain_groups ? {
(local.storage_admin_group_key) = {
identity_domain_id = trimspace(var.custom_id_domain_ocid)
name = local.provided_storage_admin_group_name
description = "Landing Zone group for storage services management."
members = []
defined_tags = local.groups_defined_tags
freeform_tags = local.groups_freeform_tags
}
} : {}
#------------------------------------------------------------------------
#-- Auditors
#------------------------------------------------------------------------
auditor_group_key = "AUDITOR-GROUP"
default_auditor_group_name = "auditor-group"
provided_auditor_group_name = coalesce(local.custom_auditor_group_name, "${var.service_label}-${local.default_auditor_group_name}")
auditor_group = length(var.existing_auditor_group_name) == 0 && length(trimspace(var.rm_existing_auditor_group_name)) == 0 ? {
(local.auditor_group_key) = {
name = local.provided_auditor_group_name
description = "Landing Zone group for auditing the tenancy."
members = []
defined_tags = local.groups_defined_tags
freeform_tags = local.groups_freeform_tags
}
} : {}
custom_domain_auditor_group = var.deploy_custom_domain_groups ? {
(local.auditor_group_key) = {
identity_domain_id = trimspace(var.custom_id_domain_ocid)
name = local.provided_auditor_group_name
description = "Landing Zone group for auditing the tenancy."
members = []
defined_tags = local.groups_defined_tags
freeform_tags = local.groups_freeform_tags
}
} : {}
#------------------------------------------------------------------------
#-- Announcement readers
#------------------------------------------------------------------------
announcement_reader_group_key = "ANNOUNCEMENT-READER-GROUP"
default_announcement_reader_group_name = "announcement-reader-group"
provided_announcement_reader_group_name = coalesce(local.custom_announcement_reader_group_name, "${var.service_label}-${local.default_announcement_reader_group_name}")
announcement_reader_group = length(var.existing_announcement_reader_group_name) == 0 && length(trimspace(var.rm_existing_announcement_reader_group_name)) == 0 ? {
(local.announcement_reader_group_key) = {
name = local.provided_announcement_reader_group_name
description = "Landing Zone group for reading Console announcements."
members = []
defined_tags = local.groups_defined_tags
freeform_tags = local.groups_freeform_tags
}
} : {}
custom_domain_announcement_reader_group = var.deploy_custom_domain_groups ? {
(local.announcement_reader_group_key) = {
identity_domain_id = trimspace(var.custom_id_domain_ocid)
name = local.provided_announcement_reader_group_name
description = "Landing Zone group for reading Console announcements."
members = []
defined_tags = local.groups_defined_tags
freeform_tags = local.groups_freeform_tags
}
} : {}
#--------------------------------------------------------------------
#-- Access Governance (AG) Admin
#--------------------------------------------------------------------
ag_admin_group_key = "AG-ADMIN-GROUP"
default_ag_admin_group_name = "access-governance-admin-group"
provided_ag_admin_group_name = coalesce(local.custom_ag_admin_group_name, "${var.service_label}-${local.default_ag_admin_group_name}")
ag_admin_group = length(var.existing_ag_admin_group_name) == 0 && length(trimspace(var.rm_existing_ag_admin_group_name)) == 0 ? {
(local.ag_admin_group_key) = {
name = local.provided_ag_admin_group_name
description = "Landing Zone group for managing Access Governance resources in the tenancy."
members = []
defined_tags = local.groups_defined_tags
freeform_tags = local.groups_freeform_tags
}
} : {}
custom_domain_ag_admin_group = var.deploy_custom_domain_groups ? {
(local.ag_admin_group_key) = {
identity_domain_id = trimspace(var.custom_id_domain_ocid)
name = local.provided_ag_admin_group_name
description = "Landing Zone group for managing Access Governance resources in the tenancy."
members = []
defined_tags = local.groups_defined_tags
freeform_tags = local.groups_freeform_tags
}
} : {}
#------------------------------------------------------------------------
#----- Groups configuration definition. Input to module.
#------------------------------------------------------------------------
groups_configuration = {
groups : merge(local.iam_admin_group, local.cred_admin_group, local.cost_admin_group,
local.network_admin_group, local.security_admin_group,
local.appdev_admin_group, local.database_admin_group, local.exainfra_admin_group,
local.storage_admin_group, local.auditor_group, local.announcement_reader_group,
local.ag_admin_group)
}
custom_domain_groups_configuration = {
groups : merge(local.custom_domain_iam_admin_group, local.custom_domain_cred_admin_group, local.custom_domain_cost_admin_group,
local.custom_domain_network_admin_group, local.custom_domain_security_admin_group,
local.custom_domain_appdev_admin_group, local.custom_domain_database_admin_group, local.custom_domain_exainfra_admin_group,
local.custom_domain_storage_admin_group, local.custom_domain_auditor_group, local.custom_domain_announcement_reader_group,
local.custom_domain_ag_admin_group)
}
empty_groups_configuration = {
groups : {}
}
#----------------------------------------------------------------------------------
#----- Processed group names, ready to be used in policies.
#----------------------------------------------------------------------------------
iam_admin_group_name = !var.extend_landing_zone_to_new_region ? (var.use_custom_id_domain == false ? ((length(var.existing_iam_admin_group_name) == 0 && length(trimspace(var.rm_existing_iam_admin_group_name)) == 0 ? [module.lz_groups.groups[local.iam_admin_group_key].name] : (length(regexall("^ocid1.group.oc.*$", var.rm_existing_iam_admin_group_name)) > 0 ? ["'${data.oci_identity_group.existing_iam_admin_group[var.rm_existing_iam_admin_group_name].name}'"] : [for i, v in var.existing_iam_admin_group_name : (length(regexall("^ocid1.group.oc.*$", var.existing_iam_admin_group_name[i])) > 0 ? "'${data.oci_identity_group.existing_iam_admin_group[v].name}'" : "'${v}'")]))) : var.deploy_custom_domain_groups == true ? ["'${local.custom_id_domain_name}'/'${local.provided_iam_admin_group_name}'"] : [for v in var.rm_existing_id_domain_iam_admin_group_name : "'${local.custom_id_domain_name}'/'${trimspace(v)}'"]) : []
cred_admin_group_name = !var.extend_landing_zone_to_new_region ? (var.use_custom_id_domain == false ? ((length(var.existing_cred_admin_group_name) == 0 && length(trimspace(var.rm_existing_cred_admin_group_name)) == 0 ? [module.lz_groups.groups[local.cred_admin_group_key].name] : (length(regexall("^ocid1.group.oc.*$", var.rm_existing_cred_admin_group_name)) > 0 ? ["'${data.oci_identity_group.existing_cred_admin_group[var.rm_existing_cred_admin_group_name].name}'"] : [for i, v in var.existing_cred_admin_group_name : (length(regexall("^ocid1.group.oc.*$", var.existing_cred_admin_group_name[i])) > 0 ? "'${data.oci_identity_group.existing_cred_admin_group[v].name}'" : "'${v}'")]))) : var.deploy_custom_domain_groups == true ? ["'${local.custom_id_domain_name}'/'${local.provided_cred_admin_group_name}'"] : [for v in var.rm_existing_id_domain_cred_admin_group_name : "'${local.custom_id_domain_name}'/'${trimspace(v)}'"]) : []
security_admin_group_name = !var.extend_landing_zone_to_new_region ? (var.use_custom_id_domain == false ? ((length(var.existing_security_admin_group_name) == 0 && length(trimspace(var.rm_existing_security_admin_group_name)) == 0 ? [module.lz_groups.groups[local.security_admin_group_key].name] : (length(regexall("^ocid1.group.oc.*$", var.rm_existing_security_admin_group_name)) > 0 ? ["'${data.oci_identity_group.existing_security_admin_group[var.rm_existing_security_admin_group_name].name}'"] : [for i, v in var.existing_security_admin_group_name : (length(regexall("^ocid1.group.oc.*$", var.existing_security_admin_group_name[i])) > 0 ? "'${data.oci_identity_group.existing_security_admin_group[v].name}'" : "'${v}'")]))) : var.deploy_custom_domain_groups == true ? ["'${local.custom_id_domain_name}'/'${local.provided_security_admin_group_name}'"] : [for v in var.rm_existing_id_domain_security_admin_group_name : "'${local.custom_id_domain_name}'/'${trimspace(v)}'"]) : []
network_admin_group_name = !var.extend_landing_zone_to_new_region ? (var.use_custom_id_domain == false ? ((length(var.existing_network_admin_group_name) == 0 && length(trimspace(var.rm_existing_network_admin_group_name)) == 0 ? [module.lz_groups.groups[local.network_admin_group_key].name] : (length(regexall("^ocid1.group.oc.*$", var.rm_existing_network_admin_group_name)) > 0 ? ["'${data.oci_identity_group.existing_network_admin_group[var.rm_existing_network_admin_group_name].name}'"] : [for i, v in var.existing_network_admin_group_name : (length(regexall("^ocid1.group.oc.*$", var.existing_network_admin_group_name[i])) > 0 ? "'${data.oci_identity_group.existing_network_admin_group[v].name}'" : "'${v}'")]))) : var.deploy_custom_domain_groups == true ? ["'${local.custom_id_domain_name}'/'${local.provided_network_admin_group_name}'"] : [for v in var.rm_existing_id_domain_network_admin_group_name : "'${local.custom_id_domain_name}'/'${trimspace(v)}'"]) : []
database_admin_group_name = !var.extend_landing_zone_to_new_region ? (var.use_custom_id_domain == false ? ((length(var.existing_database_admin_group_name) == 0 && length(trimspace(var.rm_existing_database_admin_group_name)) == 0 ? [module.lz_groups.groups[local.database_admin_group_key].name] : (length(regexall("^ocid1.group.oc.*$", var.rm_existing_database_admin_group_name)) > 0 ? ["'${data.oci_identity_group.existing_database_admin_group[var.rm_existing_database_admin_group_name].name}'"] : [for i, v in var.existing_database_admin_group_name : (length(regexall("^ocid1.group.oc.*$", var.existing_database_admin_group_name[i])) > 0 ? "'${data.oci_identity_group.existing_database_admin_group[v].name}'" : "'${v}'")]))) : var.deploy_custom_domain_groups == true ? ["'${local.custom_id_domain_name}'/'${local.provided_database_admin_group_name}'"] : [for v in var.rm_existing_id_domain_database_admin_group_name : "'${local.custom_id_domain_name}'/'${trimspace(v)}'"]) : []
appdev_admin_group_name = !var.extend_landing_zone_to_new_region ? (var.use_custom_id_domain == false ? ((length(var.existing_appdev_admin_group_name) == 0 && length(trimspace(var.rm_existing_appdev_admin_group_name)) == 0 ? [module.lz_groups.groups[local.appdev_admin_group_key].name] : (length(regexall("^ocid1.group.oc.*$", var.rm_existing_appdev_admin_group_name)) > 0 ? ["'${data.oci_identity_group.existing_appdev_admin_group[var.rm_existing_appdev_admin_group_name].name}'"] : [for i, v in var.existing_appdev_admin_group_name : (length(regexall("^ocid1.group.oc.*$", var.existing_appdev_admin_group_name[i])) > 0 ? "'${data.oci_identity_group.existing_appdev_admin_group[v].name}'" : "'${v}'")]))) : var.deploy_custom_domain_groups == true ? ["'${local.custom_id_domain_name}'/'${local.provided_appdev_admin_group_name}'"] : [for v in var.rm_existing_id_domain_appdev_admin_group_name : "'${local.custom_id_domain_name}'/'${trimspace(v)}'"]) : []
auditor_group_name = !var.extend_landing_zone_to_new_region ? (var.use_custom_id_domain == false ? ((length(var.existing_auditor_group_name) == 0 && length(trimspace(var.rm_existing_auditor_group_name)) == 0 ? [module.lz_groups.groups[local.auditor_group_key].name] : (length(regexall("^ocid1.group.oc.*$", var.rm_existing_auditor_group_name)) > 0 ? ["'${data.oci_identity_group.existing_auditor_group[var.rm_existing_auditor_group_name].name}'"] : [for i, v in var.existing_auditor_group_name : (length(regexall("^ocid1.group.oc.*$", var.existing_auditor_group_name[i])) > 0 ? "'${data.oci_identity_group.existing_auditor_group[v].name}'" : "'${v}'")]))) : var.deploy_custom_domain_groups == true ? ["'${local.custom_id_domain_name}'/'${local.provided_auditor_group_name}'"] : [for v in var.rm_existing_id_domain_auditor_group_name : "'${local.custom_id_domain_name}'/'${trimspace(v)}'"]) : []
announcement_reader_group_name = !var.extend_landing_zone_to_new_region ? (var.use_custom_id_domain == false ? ((length(var.existing_announcement_reader_group_name) == 0 && length(trimspace(var.rm_existing_announcement_reader_group_name)) == 0 ? [module.lz_groups.groups[local.announcement_reader_group_key].name] : (length(regexall("^ocid1.group.oc.*$", var.rm_existing_announcement_reader_group_name)) > 0 ? ["'${data.oci_identity_group.existing_announcement_reader_group[var.rm_existing_announcement_reader_group_name].name}'"] : [for i, v in var.existing_announcement_reader_group_name : (length(regexall("^ocid1.group.oc.*$", var.existing_announcement_reader_group_name[i])) > 0 ? "'${data.oci_identity_group.existing_announcement_reader_group[v].name}'" : "'${v}'")]))) : var.deploy_custom_domain_groups == true ? ["'${local.custom_id_domain_name}'/'${local.provided_announcement_reader_group_name}'"] : [for v in var.rm_existing_id_domain_announcement_reader_group_name : "'${local.custom_id_domain_name}'/'${trimspace(v)}'"]) : []
cost_admin_group_name = !var.extend_landing_zone_to_new_region ? (var.use_custom_id_domain == false ? ((length(var.existing_cost_admin_group_name) == 0 && length(trimspace(var.rm_existing_cost_admin_group_name)) == 0 ? [module.lz_groups.groups[local.cost_admin_group_key].name] : (length(regexall("^ocid1.group.oc.*$", var.rm_existing_cost_admin_group_name)) > 0 ? ["'${data.oci_identity_group.existing_cost_admin_group[var.rm_existing_cost_admin_group_name].name}'"] : [for i, v in var.existing_cost_admin_group_name : (length(regexall("^ocid1.group.oc.*$", var.existing_cost_admin_group_name[i])) > 0 ? "'${data.oci_identity_group.existing_cost_admin_group[v].name}'" : "'${v}'")]))) : var.deploy_custom_domain_groups == true ? ["'${local.custom_id_domain_name}'/'${local.provided_cost_admin_group_name}'"] : [for v in var.rm_existing_id_domain_cost_admin_group_name : "'${local.custom_id_domain_name}'/'${trimspace(v)}'"]) : []
storage_admin_group_name = !var.extend_landing_zone_to_new_region ? (var.use_custom_id_domain == false ? ((length(var.existing_storage_admin_group_name) == 0 && length(trimspace(var.rm_existing_storage_admin_group_name)) == 0 ? [module.lz_groups.groups[local.storage_admin_group_key].name] : (length(regexall("^ocid1.group.oc.*$", var.rm_existing_storage_admin_group_name)) > 0 ? ["'${data.oci_identity_group.existing_storage_admin_group[var.rm_existing_storage_admin_group_name].name}'"] : [for i, v in var.existing_storage_admin_group_name : (length(regexall("^ocid1.group.oc.*$", var.existing_storage_admin_group_name[i])) > 0 ? "'${data.oci_identity_group.existing_storage_admin_group[v].name}'" : "'${v}'")]))) : var.deploy_custom_domain_groups == true ? ["'${local.custom_id_domain_name}'/'${local.provided_storage_admin_group_name}'"] : [for v in var.rm_existing_id_domain_storage_admin_group_name : "'${local.custom_id_domain_name}'/'${trimspace(v)}'"]) : []
exainfra_admin_group_name = !var.extend_landing_zone_to_new_region ? (var.use_custom_id_domain == false ? ((var.deploy_exainfra_cmp ? (length(var.existing_exainfra_admin_group_name) == 0 && length(trimspace(var.rm_existing_exainfra_admin_group_name)) == 0 ? [module.lz_groups.groups[local.exainfra_admin_group_key].name] : (length(regexall("^ocid1.group.oc.*$", var.rm_existing_exainfra_admin_group_name)) > 0 ? ["'${data.oci_identity_group.existing_exainfra_admin_group[var.rm_existing_exainfra_admin_group_name].name}'"] : [for i, v in var.existing_exainfra_admin_group_name : (length(regexall("^ocid1.group.oc.*$", var.existing_exainfra_admin_group_name[i])) > 0 ? "'${data.oci_identity_group.existing_exainfra_admin_group[v].name}'" : "'${v}'")])) : [for grp in var.existing_exainfra_admin_group_name : "'${grp}'"])) : var.deploy_custom_domain_groups == true ? ["'${local.custom_id_domain_name}'/'${local.provided_exainfra_admin_group_name}'"] : [for v in var.rm_existing_id_domain_exainfra_admin_group_name : "'${local.custom_id_domain_name}'/'${trimspace(v)}'"]) : []
ag_admin_group_name = !var.extend_landing_zone_to_new_region ? (var.use_custom_id_domain == false ? ((length(var.existing_ag_admin_group_name) == 0 && length(trimspace(var.rm_existing_ag_admin_group_name)) == 0 ? [module.lz_groups.groups[local.ag_admin_group_key].name] : (length(regexall("^ocid1.group.oc.*$", var.rm_existing_ag_admin_group_name)) > 0 ? ["'${data.oci_identity_group.existing_ag_admin_group[var.rm_existing_ag_admin_group_name].name}'"] : [for i, v in var.existing_ag_admin_group_name : (length(regexall("^ocid1.group.oc.*$", var.existing_ag_admin_group_name[i])) > 0 ? "'${data.oci_identity_group.existing_ag_admin_group[v].name}'" : "'${v}'")]))) : var.deploy_custom_domain_groups == true ? ["'${local.custom_id_domain_name}'/'${local.provided_ag_admin_group_name}'"] : [for v in var.rm_existing_id_domain_ag_admin_group_name : "'${local.custom_id_domain_name}'/'${trimspace(v)}'"]) : []
}