@@ -14,35 +14,35 @@ variable "compartment_id" {
1414 type = string
1515 description = " The OCID of the compartment for the matching rule of dynamic group"
1616 validation {
17- condition = length (regexall (" ^ocid1.compartment.*$" , var. compartment_id )) > 0
18- error_message = " WLSC-ERROR: The value for compartment_id should start with \" ocid1.compartment.\" ."
17+ condition = length (regexall (" ^ocid1.compartment.*$" , var. compartment_id )) > 0 || length ( regexall ( " ^ocid1.tenancy.*$ " , var . compartment_id )) > 0
18+ error_message = " WLSC-ERROR: The value for compartment_id should start with \" ocid1.compartment.\" or \" ocid1.tenancy. \" ."
1919 }
2020}
2121
2222variable "network_compartment_id" {
2323 type = string
2424 description = " The OCID of the compartment where the network resources like VCN are located"
2525 validation {
26- condition = length (regexall (" ^ocid1.compartment.*$" , var. network_compartment_id )) > 0
27- error_message = " WLSC-ERROR: The value for network_compartment_id should start with \" ocid1.compartment.\" ."
26+ condition = length (regexall (" ^ocid1.compartment.*$" , var. network_compartment_id )) > 0 || length ( regexall ( " ^ocid1.tenancy.*$ " , var . network_compartment_id )) > 0
27+ error_message = " WLSC-ERROR: The value for network_compartment_id should start with \" ocid1.compartment.\" or \" ocid1.tenancy. \" ."
2828 }
2929}
3030
3131variable "fss_compartment_id" {
3232 type = string
3333 description = " The OCID of the compartment where the file system exists"
3434 validation {
35- condition = length (regexall (" ^ocid1.compartment.*$" , var. fss_compartment_id )) > 0
36- error_message = " WLSC-ERROR: The value for fss_compartment_id should start with \" ocid1.compartment.\" ."
35+ condition = length (regexall (" ^ocid1.compartment.*$" , var. fss_compartment_id )) > 0 || length ( regexall ( " ^ocid1.tenancy.*$ " , var . fss_compartment_id )) > 0
36+ error_message = " WLSC-ERROR: The value for fss_compartment_id should start with \" ocid1.compartment.\" or \" ocid1.tenancy. \" ."
3737 }
3838}
3939
4040variable "mount_target_compartment_id" {
4141 type = string
4242 description = " The OCID of the compartment where the mount target exists"
4343 validation {
44- condition = length (regexall (" ^ocid1.compartment.*$" , var. mount_target_compartment_id )) > 0
45- error_message = " WLSC-ERROR: The value for mount_target_compartment_id should start with \" ocid1.compartment.\" ."
44+ condition = length (regexall (" ^ocid1.compartment.*$" , var. mount_target_compartment_id )) > 0 || length ( regexall ( " ^ocid1.tenancy.*$ " , var . mount_target_compartment_id )) > 0
45+ error_message = " WLSC-ERROR: The value for mount_target_compartment_id should start with \" ocid1.compartment.\" or \" ocid1.tenancy. \" ."
4646 }
4747}
4848
0 commit comments