Skip to content

Commit 87c0b98

Browse files
fix
1 parent 7c2c3fb commit 87c0b98

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

solutions/fully-configurable/variables.tf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,28 @@ variable "existing_cluster_crn" {
5757
type = string
5858
description = "The CRN of the to deploy ESO operator onto. This value cannot be null."
5959
nullable = false
60+
61+
validation {
62+
condition = anytrue([
63+
can(regex("^crn:v\\d:(.*:){2}containers-kubernetes:(.*:)([aos]\\/[\\w_\\-]+):[0-9a-fA-F]{20}::$", var.existing_cluster_crn)),
64+
var.existing_cluster_crn == null,
65+
])
66+
error_message = "The value provided for 'existing_cluster_crn' is not valid."
67+
}
6068
}
6169

6270
variable "existing_secrets_manager_crn" {
6371
type = string
6472
description = "The CRN of the existing Secrets Manager instance to use. This value cannot be null."
6573
nullable = false
74+
75+
validation {
76+
condition = anytrue([
77+
can(regex("^crn:v\\d:(.*:){2}secrets-manager:(.*:)([aos]\\/[\\w_\\-]+):[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}::$", var.existing_secrets_manager_crn)),
78+
var.existing_secrets_manager_crn == null,
79+
])
80+
error_message = "The value provided for 'existing_secrets_manager_crn' is not valid."
81+
}
6682
}
6783

6884
############################################################################################################

0 commit comments

Comments
 (0)