Skip to content

Commit c4bd185

Browse files
iamar7Md Anam Raihan
andauthored
feat: Add Project UI regex validation for the DA (#1062)
* feat: added regex validation to DA inputs * update cdev * update description --------- Co-authored-by: Md Anam Raihan <[email protected]>
1 parent 2687f1e commit c4bd185

File tree

2 files changed

+25
-4
lines changed

2 files changed

+25
-4
lines changed

ibm_catalog.json

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,14 @@
199199
},
200200
{
201201
"key": "prefix",
202-
"required": true
202+
"required": true,
203+
"value_constraints": [
204+
{
205+
"type": "regex",
206+
"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.",
207+
"value": "^$|^__NULL__$|^[a-z](?!.*--)(?:[a-z0-9-]{0,14}[a-z0-9])?$"
208+
}
209+
]
203210
},
204211
{
205212
"key": "region",
@@ -377,7 +384,14 @@
377384
"key": "enable_vpc_flow_logs"
378385
},
379386
{
380-
"key": "existing_cos_instance_crn"
387+
"key": "existing_cos_instance_crn",
388+
"value_constraints": [
389+
{
390+
"type": "regex",
391+
"description": "The value provided for 'existing_cos_instance_crn' is not valid.",
392+
"value": "^crn:(.*:){3}cloud-object-storage:(.*:){2}[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}::$"
393+
}
394+
]
381395
},
382396
{
383397
"key": "skip_vpc_cos_iam_auth_policy"
@@ -392,7 +406,14 @@
392406
"key": "existing_flow_logs_bucket_kms_key_crn"
393407
},
394408
{
395-
"key": "existing_kms_instance_crn"
409+
"key": "existing_kms_instance_crn",
410+
"value_constraints": [
411+
{
412+
"type": "regex",
413+
"description": "The value provided for 'existing_kms_instance_crn' is not valid.",
414+
"value": "^__NULL__$|^crn:(.*:){3}(kms|hs-crypto):(.*:){2}[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}::$"
415+
}
416+
]
396417
},
397418
{
398419
"key": "skip_cos_kms_iam_auth_policy"

solutions/fully-configurable/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ variable "existing_resource_group_name" {
2828
variable "prefix" {
2929
type = string
3030
nullable = true
31-
description = "The prefix to be added to all resources created by this solution. To skip using a prefix, set this value to null or an empty string. The prefix must begin with a lowercase letter and may contain only lowercase letters, digits, and hyphens '-'. It should not exceed 16 characters, must not end with a hyphen('-'), and cannot contain consecutive hyphens ('--'). Example: prod-0205-vpc. [Learn more](https://terraform-ibm-modules.github.io/documentation/#/prefix.md)."
31+
description = "The prefix to add to all resources that this solution creates (e.g `prod`, `test`, `dev`). To skip using a prefix, set this value to null or an empty string. [Learn more](https://terraform-ibm-modules.github.io/documentation/#/prefix.md)."
3232

3333
validation {
3434
# - null and empty string is allowed

0 commit comments

Comments
 (0)