Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions terraform/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ locals {
wls_admin_port = var.configure_secure_mode ? var.administration_port : var.wls_admin_port
keystore_password_id = var.configure_secure_mode ? var.keystore_password_id : ""
root_ca_id = var.configure_secure_mode ? var.root_ca_id : ""
cert_compartment_id = var.cert_compartment_id == "" ? local.network_compartment_id : var.cert_compartment_id
wls_domain_configuration = var.configure_secure_mode ? "Secured Production Mode" : "Production Mode"
wls_extern_ssl_admin_port = var.configure_secure_mode ? var.administration_port : var.wls_extern_ssl_admin_port
wls_admin_user = var.configure_secure_mode ? var.wls_primary_admin_user : var.wls_admin_user
Expand Down
4 changes: 4 additions & 0 deletions terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ module "policies" {
is_rms_private_endpoint_required = local.is_rms_private_endpoint_required
configure_secure_mode = var.configure_secure_mode
keystore_password_id = local.keystore_password_id
cert_compartment_id = local.cert_compartment_id
}

module "bastion" {
Expand Down Expand Up @@ -474,6 +475,8 @@ module "validators" {
keystore_password_id = local.keystore_password_id
root_ca_id = local.root_ca_id
wls_secondary_admin_password_id = local.wls_secondary_admin_password_id
administration_port = var.administration_port
ms_administration_port = var.ms_administration_port
}

module "fss" {
Expand Down Expand Up @@ -627,6 +630,7 @@ module "compute" {
ms_administration_port = var.ms_administration_port
keystore_password_id = local.keystore_password_id
root_ca_id = local.root_ca_id
cert_compartment_id = local.cert_compartment_id
thread_pool_limit = var.thread_pool_limit
wls_secondary_admin_user = var.wls_secondary_admin_user
wls_secondary_admin_password_id = local.wls_secondary_admin_password_id
Expand Down
5 changes: 5 additions & 0 deletions terraform/modules/compute/wls_compute/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,11 @@ variable "root_ca_id" {
description = "The OCID of the existing root certificate authority to issue the certificates"
}

variable "cert_compartment_id" {
type = string
description = "The OCID of the compartment where the certificate will be created. Leave it blank to use the network compartment for the certificate"
}

variable "thread_pool_limit" {
type = number
description = "Shared Capacity For Work Managers"
Expand Down
1 change: 1 addition & 0 deletions terraform/modules/compute/wls_compute/wls_compute.tf
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ module "wls-instances" {
keystore_dir = var.keystore_dir
keystore_password_id = var.keystore_password_id
root_ca_id = var.root_ca_id
cert_compartment_id = var.cert_compartment_id
thread_pool_limit = var.thread_pool_limit
wls_secondary_admin_user = var.wls_secondary_admin_user
wls_secondary_admin_password_ocid = var.wls_secondary_admin_password_id
Expand Down
6 changes: 3 additions & 3 deletions terraform/modules/policies/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ locals {
])

#Policies for creating wildcard certificate to configure SSL in secured production mode
secure_mode_statement1 = var.configure_secure_mode ? "Allow dynamic-group ${oci_identity_dynamic_group.wlsc_instance_principal_group.name} to use certificate-authority-delegates in compartment id ${var.compartment_id}" : ""
secure_mode_statement2 = var.configure_secure_mode ? "Allow dynamic-group ${oci_identity_dynamic_group.wlsc_instance_principal_group.name} to manage leaf-certificates in compartment id ${var.compartment_id}" : ""
secure_mode_statement3 = var.configure_secure_mode ? "Allow dynamic-group ${oci_identity_dynamic_group.wlsc_instance_principal_group.name} to read leaf-certificate-bundles in compartment id ${var.compartment_id} where target.leaf-certificate.bundle-type = 'CERTIFICATE_CONTENT_PUBLIC_ONLY'" : ""
secure_mode_statement1 = var.configure_secure_mode ? "Allow dynamic-group ${oci_identity_dynamic_group.wlsc_instance_principal_group.name} to use certificate-authority-delegates in compartment id ${var.cert_compartment_id}" : ""
secure_mode_statement2 = var.configure_secure_mode ? "Allow dynamic-group ${oci_identity_dynamic_group.wlsc_instance_principal_group.name} to manage leaf-certificates in compartment id ${var.cert_compartment_id}" : ""
secure_mode_statement3 = var.configure_secure_mode ? "Allow dynamic-group ${oci_identity_dynamic_group.wlsc_instance_principal_group.name} to read leaf-certificate-bundles in compartment id ${var.cert_compartment_id} where target.leaf-certificate.bundle-type = 'CERTIFICATE_CONTENT_PUBLIC_ONLY'" : ""
#Policy for reading keystore password secret
secure_mode_secrets_policy_statement = (var.configure_secure_mode && var.keystore_password_id != "") ? "Allow dynamic-group ${oci_identity_dynamic_group.wlsc_instance_principal_group.name} to read secret-bundles in tenancy where target.secret.id = '${var.keystore_password_id}'" : ""
secure_mode_statement = compact([local.secure_mode_statement1, local.secure_mode_statement2, local.secure_mode_statement3, local.secure_mode_secrets_policy_statement])
Expand Down
5 changes: 5 additions & 0 deletions terraform/modules/policies/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,8 @@ variable "keystore_password_id" {
type = string
description = "The OCID of the vault secret with the password for creating the keystore"
}

variable "cert_compartment_id" {
type = string
description = "The OCID of the compartment where the certificate will be created. Leave it blank to use the network compartment for the certificate"
}
5 changes: 5 additions & 0 deletions terraform/modules/validators/validators.tf
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ locals {
script_version_msg = "WLSC-ERROR: The value for tf script version cannot be empty. Please provide valid script version that matches with version on the image."
validate_script_version = local.invalid_script_version ? local.validators_msg_map[local.script_version_msg] : null

# Validations related to Secure Production Mode
missing_keystore_password_id = var.configure_secure_mode && var.keystore_password_id == ""
keystore_password_id_required_msg = "WLSC-ERROR: The value for keystore_password_id is required when enabling secure production mode."
validate_missing_keystore_password_id = local.missing_keystore_password_id ? local.validators_msg_map[local.keystore_password_id_required_msg] : null
Expand All @@ -74,4 +75,8 @@ locals {
invalid_wls_secondary_admin_password_id = var.configure_secure_mode && length(regexall("^ocid1.vaultsecret.", var.wls_secondary_admin_password_id)) <= 0
invalid_wls_secondary_admin_password_id_required_msg = "WLSC-ERROR: The value for wls_secondary_admin_password_id should start with \"ocid1.vaultsecret.\""
validate_wls_secondary_admin_password_id = local.missing_wls_secondary_admin_password_id ? local.validators_msg_map[local.missing_wls_secondary_admin_password_id_required_msg] : (local.invalid_wls_secondary_admin_password_id ? local.validators_msg_map[local.invalid_wls_secondary_admin_password_id_required_msg] : null)

invalid_administration_ports = var.configure_secure_mode && var.administration_port == var.ms_administration_port
invalid_administration_ports_msg = "WLSC-ERROR: The value for administration_port=[${var.administration_port}] and ms_administration_port=[${var.ms_administration_port}] cannot be same."
validate_administration_ports = local.invalid_administration_ports ? local.validators_msg_map[local.invalid_administration_ports_msg] : null
}
10 changes: 10 additions & 0 deletions terraform/modules/validators/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -553,4 +553,14 @@ variable "root_ca_id" {
variable "wls_secondary_admin_password_id" {
type = string
description = "The OCID of the vault secret with the password for secondary WebLogic administration user"
}

variable "administration_port" {
type = number
description = "The domain-wide administration port to configure a secure WebLogic domain"
}

variable "ms_administration_port" {
type = number
description = "The administration port for managed servers to configure a secure WebLogic domain"
}
17 changes: 16 additions & 1 deletion terraform/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ groupings:
- ${wls_secondary_admin_password_id}
- ${keystore_password_id}
- ${root_ca_id}
- ${cert_compartment_id}
- ${preserve_boot_properties}
- ${add_JRF}
#Start of JRF fields
Expand Down Expand Up @@ -551,6 +552,8 @@ variables:
and:
- ${orm_create_mode}
- ${configure_wls_ports}
- not:
- ${configure_secure_mode}
type: integer
default: 7002
minimum: 1024
Expand Down Expand Up @@ -807,7 +810,7 @@ variables:
- ${configure_secure_mode}
type: boolean
required: true
default: true
default: false
title: "Preserve the boot.properties file for administration server and managed servers"
description: "Preserve the boot.properties file for administration server and managed servers. NOTE: Leaving this unchecked (false) will result in node manager being unable to revive servers if they are killed."

Expand Down Expand Up @@ -866,6 +869,18 @@ variables:
title: "Existing Root Certificate Authority ID"
description: "The OCID of the existing root certificate authority to issue the certificates"

cert_compartment_id:
visible:
and:
- ${orm_create_mode}
- ${configure_secure_mode}
- ${create_policies}
type: oci:identity:compartment:id
required: false
title: "Certificate Compartment"
description: "The compartment where you want to create the certificate"
default: ${network_compartment_id}

thread_pool_limit:
visible:
and:
Expand Down
17 changes: 16 additions & 1 deletion terraform/schema_14110.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ groupings:
- ${wls_secondary_admin_password_id}
- ${keystore_password_id}
- ${root_ca_id}
- ${cert_compartment_id}
- ${preserve_boot_properties}
- ${wls_14c_jdk_version}
- ${deploy_sample_app}
Expand Down Expand Up @@ -560,6 +561,8 @@ variables:
and:
- ${orm_create_mode}
- ${configure_wls_ports}
- not:
- ${configure_secure_mode}
type: integer
default: 7002
minimum: 1024
Expand Down Expand Up @@ -816,7 +819,7 @@ variables:
- ${configure_secure_mode}
type: boolean
required: true
default: true
default: false
title: "Preserve the boot.properties file for administration server and managed servers"
description: "Preserve the boot.properties file for administration server and managed servers. NOTE: Leaving this unchecked (false) will result in node manager being unable to revive servers if they are killed."

Expand Down Expand Up @@ -875,6 +878,18 @@ variables:
title: "Existing Root Certificate Authority ID"
description: "The OCID of the existing root certificate authority to issue the certificates"

cert_compartment_id:
visible:
and:
- ${orm_create_mode}
- ${configure_secure_mode}
- ${create_policies}
type: oci:identity:compartment:id
required: false
title: "Certificate Compartment"
description: "The compartment where you want to create the certificate"
default: ${network_compartment_id}

thread_pool_limit:
visible:
and:
Expand Down
8 changes: 7 additions & 1 deletion terraform/weblogic_variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ variable "configure_secure_mode" {
variable "preserve_boot_properties" {
type = bool
description = "Set to true to preserve the boot.properties file for administration server and managed servers"
default = "true"
default = "false"
}

variable "keystore_password_id" {
Expand All @@ -222,6 +222,12 @@ variable "root_ca_id" {
default = ""
}

variable "cert_compartment_id" {
type = string
description = "The OCID of the compartment where the certificate will be created. Leave it blank to use the network compartment for the certificate"
default = ""
}

variable "administration_port" {
type = number
description = "The domain-wide administration port to configure a secure WebLogic domain"
Expand Down