Skip to content

Commit a2971a9

Browse files
authored
Topic sk jcs 13348 fix condition (#207)
Fix one condition in policy
1 parent 1d920fb commit a2971a9

File tree

3 files changed

+22
-16
lines changed

3 files changed

+22
-16
lines changed

terraform/main.tf

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -223,21 +223,22 @@ module "policies" {
223223
defined_tags = local.defined_tags
224224
freeform_tags = local.free_form_tags
225225
}
226-
atp_db = local.atp_db
227-
oci_db = local.oci_db
228-
vcn_id = element(concat(module.network-vcn[*].vcn_id, [""]), 0)
229-
wls_existing_vcn_id = var.wls_existing_vcn_id
230-
is_idcs_selected = var.is_idcs_selected
231-
idcs_client_secret_id = var.idcs_client_secret_id
232-
use_oci_logging = var.use_oci_logging
233-
use_apm_service = local.use_apm_service
234-
apm_domain_compartment_id = local.apm_domain_compartment_id
235-
use_autoscaling = var.use_autoscaling
236-
ocir_auth_token_id = var.ocir_auth_token_id
237-
add_fss = var.add_fss
238-
add_load_balancer = local.add_load_balancer
239-
fss_compartment_id = var.fss_compartment_id == "" ? var.compartment_ocid : var.fss_compartment_id
240-
mount_target_compartment_id = var.mount_target_compartment_id == "" ? var.compartment_ocid : var.mount_target_compartment_id
226+
atp_db = local.atp_db
227+
oci_db = local.oci_db
228+
vcn_id = element(concat(module.network-vcn[*].vcn_id, [""]), 0)
229+
wls_existing_vcn_id = var.wls_existing_vcn_id
230+
is_idcs_selected = var.is_idcs_selected
231+
idcs_client_secret_id = var.idcs_client_secret_id
232+
use_oci_logging = var.use_oci_logging
233+
use_apm_service = local.use_apm_service
234+
apm_domain_compartment_id = local.apm_domain_compartment_id
235+
use_autoscaling = var.use_autoscaling
236+
ocir_auth_token_id = var.ocir_auth_token_id
237+
add_fss = var.add_fss
238+
add_load_balancer = local.add_load_balancer
239+
fss_compartment_id = var.fss_compartment_id == "" ? var.compartment_ocid : var.fss_compartment_id
240+
mount_target_compartment_id = var.mount_target_compartment_id == "" ? var.compartment_ocid : var.mount_target_compartment_id
241+
is_rms_private_endpoint_required = local.is_rms_private_endpoint_required
241242
}
242243

243244
module "bastion" {

terraform/modules/policies/locals.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ locals {
7575
autoscaling_statement25 = var.use_autoscaling ? length(oci_identity_dynamic_group.wlsc_functions_principal_group) > 0 ? "Allow dynamic-group ${oci_identity_dynamic_group.wlsc_functions_principal_group[0].name} to inspect dynamic-groups in tenancy" : "" : ""
7676
autoscaling_statement26 = var.use_autoscaling ? length(oci_identity_dynamic_group.wlsc_functions_principal_group) > 0 ? "Allow dynamic-group ${oci_identity_dynamic_group.wlsc_functions_principal_group[0].name} to manage policies in tenancy" : "" : ""
7777
autoscaling_statement27 = var.use_autoscaling ? length(oci_identity_dynamic_group.wlsc_functions_principal_group) > 0 ? "Allow dynamic-group ${oci_identity_dynamic_group.wlsc_functions_principal_group[0].name} to use tag-namespaces in tenancy" : "" : ""
78-
autoscaling_statement28 = var.use_autoscaling ? length(oci_identity_dynamic_group.wlsc_functions_principal_group) > 0 ? "Allow dynamic-group ${oci_identity_dynamic_group.wlsc_functions_principal_group[0].name} to manage orm-family in compartment id ${var.network_compartment_id}" : "" : ""
78+
autoscaling_statement28 = var.use_autoscaling && var.network_compartment_id != var.compartment_id && var.is_rms_private_endpoint_required ? length(oci_identity_dynamic_group.wlsc_functions_principal_group) > 0 ? "Allow dynamic-group ${oci_identity_dynamic_group.wlsc_functions_principal_group[0].name} to manage orm-family in compartment id ${var.network_compartment_id}" : "" : ""
7979
autoscaling_atp_policy_statement = (var.atp_db.is_atp && var.use_autoscaling) ? length(oci_identity_dynamic_group.wlsc_functions_principal_group) > 0 ? "Allow dynamic-group ${oci_identity_dynamic_group.wlsc_functions_principal_group[0].name} to inspect autonomous-transaction-processing-family in compartment id ${var.atp_db.compartment_id}" : "" : ""
8080
autoscaling_db_policy_statement = (local.is_oci_db && var.use_autoscaling) ? length(oci_identity_dynamic_group.wlsc_functions_principal_group) > 0 ? "Allow dynamic-group ${oci_identity_dynamic_group.wlsc_functions_principal_group[0].name} to inspect database-family in compartment id ${var.oci_db.compartment_id}" : "" : ""
8181
autoscaling_fss_mount_target_policy_statement = (var.add_fss && var.use_autoscaling) ? length(oci_identity_dynamic_group.wlsc_functions_principal_group) > 0 ? "Allow dynamic-group ${oci_identity_dynamic_group.wlsc_functions_principal_group[0].name} to manage mount-targets in compartment id ${var.mount_target_compartment_id}" : "" : ""

terraform/modules/policies/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,3 +187,8 @@ variable "add_load_balancer" {
187187
description = "If this variable is true and existing_load_balancer is blank, a new load balancer will be created for the stack. If existing_load_balancer_id is not blank, the specified load balancer will be used"
188188
default = false
189189
}
190+
191+
variable "is_rms_private_endpoint_required" {
192+
type = bool
193+
description = "Set resource manager private endpoint"
194+
}

0 commit comments

Comments
 (0)