Skip to content

Commit 472f216

Browse files
feat: added regex validation to several DA inputs (#774)
1 parent 1ff2d44 commit 472f216

File tree

1 file changed

+72
-9
lines changed

1 file changed

+72
-9
lines changed

ibm_catalog.json

Lines changed: 72 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,14 @@
235235
},
236236
{
237237
"key": "prefix",
238-
"required": true
238+
"required": true,
239+
"value_constraints": [
240+
{
241+
"type": "regex",
242+
"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",
243+
"value": "^$|^__NULL__$|^[a-z](?!.*--)[a-z0-9-]{0,14}[a-z0-9]$"
244+
}
245+
]
239246
},
240247
{
241248
"key": "cluster_name",
@@ -474,7 +481,14 @@
474481
},
475482
{
476483
"key": "existing_vpc_crn",
477-
"required": true
484+
"required": true,
485+
"value_constraints": [
486+
{
487+
"type": "regex",
488+
"description": "The value provided for 'existing_vpc_crn' is not valid.",
489+
"value": "^crn:(.*:){3}is:(.*:){2}:vpc:[0-9a-z]{4}-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
490+
}
491+
]
478492
},
479493
{
480494
"key": "region",
@@ -494,7 +508,14 @@
494508
},
495509
{
496510
"key": "existing_cos_instance_crn",
497-
"required": true
511+
"required": true,
512+
"value_constraints": [
513+
{
514+
"type": "regex",
515+
"description": "The value provided for 'existing_cos_instance_crn' is not valid.",
516+
"value": "^crn:(.*:){3}cloud-object-storage:(.*:){2}[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}::$"
517+
}
518+
]
498519
},
499520
{
500521
"key": "disable_public_endpoint",
@@ -700,10 +721,24 @@
700721
"key": "kms_encryption_enabled_cluster"
701722
},
702723
{
703-
"key": "existing_kms_instance_crn"
724+
"key": "existing_kms_instance_crn",
725+
"value_constraints": [
726+
{
727+
"type": "regex",
728+
"description": "The value provided for 'existing_kms_instance_crn' is not valid.",
729+
"value": "^__NULL__$|^crn:(.*:){3}(kms|hs-crypto):(.*:){2}[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}::$"
730+
}
731+
]
704732
},
705733
{
706-
"key": "existing_cluster_kms_key_crn"
734+
"key": "existing_cluster_kms_key_crn",
735+
"value_constraints": [
736+
{
737+
"type": "regex",
738+
"description": "The value provided for 'existing_cluster_kms_key_crn' in not valid.",
739+
"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}$"
740+
}
741+
]
707742
},
708743
{
709744
"key": "kms_endpoint_type",
@@ -729,7 +764,14 @@
729764
"key": "kms_encryption_enabled_boot_volume"
730765
},
731766
{
732-
"key": "existing_boot_volume_kms_key_crn"
767+
"key": "existing_boot_volume_kms_key_crn",
768+
"value_constraints": [
769+
{
770+
"type": "regex",
771+
"description": "The value provided for 'existing_boot_volume_kms_key_crn' in not valid.",
772+
"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}$"
773+
}
774+
]
733775
},
734776
{
735777
"key": "boot_volume_kms_key_name"
@@ -751,10 +793,24 @@
751793
"key": "enable_secrets_manager_integration"
752794
},
753795
{
754-
"key": "existing_secrets_manager_instance_crn"
796+
"key": "existing_secrets_manager_instance_crn",
797+
"value_constraints": [
798+
{
799+
"type": "regex",
800+
"description": "The value provided for 'existing_secrets_manager_instance_crn' is not valid.",
801+
"value": "^__NULL__$|^crn:(.*:){3}secrets-manager:(.*:){2}[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}::$"
802+
}
803+
]
755804
},
756805
{
757-
"key": "secrets_manager_secret_group_id"
806+
"key": "secrets_manager_secret_group_id",
807+
"value_constraints": [
808+
{
809+
"type": "regex",
810+
"description": "The value provided for 'secrets_manager_secret_group_id' is not valid.",
811+
"value": "^__NULL__$|[a-fA-F0-9]{8}-([a-fA-F0-9]{4}-){3}[a-fA-F0-9]{12}"
812+
}
813+
]
758814
},
759815
{
760816
"key": "secrets_manager_endpoint_type",
@@ -1144,7 +1200,14 @@
11441200
},
11451201
{
11461202
"key": "prefix",
1147-
"required": true
1203+
"required": true,
1204+
"value_constraints": [
1205+
{
1206+
"type": "regex",
1207+
"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",
1208+
"value": "^$|^__NULL__$|^[a-z](?!.*--)[a-z0-9-]{0,14}[a-z0-9]$"
1209+
}
1210+
]
11481211
},
11491212
{
11501213
"key": "region",

0 commit comments

Comments
 (0)