Skip to content

Commit 10b3627

Browse files
committed
add regex validation
1 parent 6d6e2df commit 10b3627

File tree

1 file changed

+32
-4
lines changed

1 file changed

+32
-4
lines changed

ibm_catalog.json

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,14 @@
6666
},
6767
{
6868
"key": "prefix",
69-
"required": true
69+
"required": true,
70+
"value_constraints": [
71+
{
72+
"type": "regex",
73+
"description": "Prefix must begin with a lowercase letter and may contain only lowercase letters, digits, and hyphens '-'. It must not end with a hyphen('-'), and cannot contain consecutive hyphens ('--'). It should not exceed 16 characters",
74+
"value": "^$|^__NULL__$|^[a-z](?!.*--)(?:[a-z0-9-]{0,14}[a-z0-9])?$"
75+
}
76+
]
7077
},
7178
{
7279
"key": "region",
@@ -270,10 +277,24 @@
270277
"key": "ibmcloud_kms_api_key"
271278
},
272279
{
273-
"key": "existing_kms_instance_crn"
280+
"key": "existing_kms_instance_crn",
281+
"value_constraints": [
282+
{
283+
"type": "regex",
284+
"description": "The value provided for 'existing_kms_instance_crn' is not valid.",
285+
"value": "^__NULL__$|^crn:(.*:){3}(kms|hs-crypto):(.*:){2}[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}::$"
286+
}
287+
]
274288
},
275289
{
276-
"key": "existing_kms_key_crn"
290+
"key": "existing_kms_key_crn",
291+
"value_constraints": [
292+
{
293+
"type": "regex",
294+
"description": "The value provided for 'existing_kms_key_crn' in not valid.",
295+
"value": "^__NULL__$|^crn:(.*:){3}(kms|hs-crypto):(.*:){2}[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}:key:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
296+
}
297+
]
277298
},
278299
{
279300
"key": "kms_endpoint_type",
@@ -305,7 +326,14 @@
305326
"key": "skip_app_config_event_notifications_auth_policy"
306327
},
307328
{
308-
"key": "existing_event_notifications_instance_crn"
329+
"key": "existing_event_notifications_instance_crn",
330+
"value_constraints": [
331+
{
332+
"type": "regex",
333+
"description": "The value provided for 'existing_event_notifications_instance_crn' in not valid.",
334+
"value": "^__NULL__$|^crn:(.*:){3}event-notifications:(.*:){2}[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}::$"
335+
}
336+
]
309337
},
310338
{
311339
"key": "event_notifications_endpoint_url"

0 commit comments

Comments
 (0)