@@ -156,6 +156,24 @@ variable "existing_serviceref_zone" {
156
156
{
157
157
zone_id = string
158
158
}))
159
+ validation {
160
+ condition = var.existing_serviceref_zone == null || (alltrue ([for zone in var . existing_serviceref_zone : can (regex (" ^[0-9a-fA-F]{32}$" , zone. zone_id ))]))
161
+ error_message = " Value should be a valid zone id with 32 alphanumeric characters"
162
+ }
163
+ validation {
164
+ condition = alltrue ([
165
+ for key , _ in var . existing_serviceref_zone :
166
+ contains ([" cloud-object-storage" , " codeengine" , " containers-kubernetes" ,
167
+ " databases-for-cassandra" , " databases-for-elasticsearch" , " databases-for-enterprisedb" ,
168
+ " databases-for-etcd" , " databases-for-mongodb" ,
169
+ " databases-for-mysql" , " databases-for-postgresql" ,
170
+ " databases-for-redis" , " directlink" ,
171
+ " iam-groups" , " is" , " messagehub" ,
172
+ " messages-for-rabbitmq" , " schematics" , " secrets-manager" , " server-protect" , " user-management" ,
173
+ " apprapp" , " compliance" , " event-notifications" , " logdna" , " logdnaat" ], key)
174
+ ])
175
+ error_message = " Provide a valid service reference"
176
+ }
159
177
description = " Provide a valid service reference and existing zone id"
160
178
default = {}
161
179
}
@@ -165,6 +183,10 @@ variable "existing_cbr_zone_vpcs" {
165
183
{
166
184
zone_id = string
167
185
})
186
+ validation {
187
+ condition = var.existing_cbr_zone_vpcs == null || (can (regex (" ^[0-9a-fA-F]{32}$" , var. existing_cbr_zone_vpcs . zone_id )))
188
+ error_message = " Value should be a valid zone id with 32 alphanumeric characters"
189
+ }
168
190
description = " Provide a existing zone id for VPC"
169
191
default = null
170
192
}
0 commit comments