From 9db4d5f4f957c460953eee46f59624f484399d45 Mon Sep 17 00:00:00 2001 From: Aditya-ranjan-16 Date: Tue, 21 Oct 2025 13:10:43 +0530 Subject: [PATCH 1/3] feat: Add UI regex validation --- ibm_catalog.json | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/ibm_catalog.json b/ibm_catalog.json index 0c8ff39..9004e3a 100644 --- a/ibm_catalog.json +++ b/ibm_catalog.json @@ -245,7 +245,13 @@ { "key": "prefix", "required": true, - "description": "The prefix to add to all resources that this solution creates. To not use any prefix value, you can enter the string `__NULL__`." + "value_constraints": [ + { + "type": "regex", + "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.", + "value": "^$|^__NULL__$|^[a-z](?!.*--)(?:[a-z0-9-]{0,14}[a-z0-9])?$" + } + ] }, { "key": "existing_resource_group_name", @@ -748,7 +754,14 @@ "configuration": [ { "key": "prefix", - "required": true + "required": true, + "value_constraints": [ + { + "type": "regex", + "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.", + "value": "^$|^__NULL__$|^[a-z](?!.*--)(?:[a-z0-9-]{0,14}[a-z0-9])?$" + } + ] }, { "key": "existing_resource_group_name", From e4eeddcb8f6f0ff7cdc3174038a7a2889c01d2c5 Mon Sep 17 00:00:00 2001 From: Aditya-ranjan-16 Date: Tue, 21 Oct 2025 13:25:39 +0530 Subject: [PATCH 2/3] fix --- solutions/fully-configurable/variables.tf | 2 +- solutions/quickstart/variables.tf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/solutions/fully-configurable/variables.tf b/solutions/fully-configurable/variables.tf index 19de48a..410ddec 100644 --- a/solutions/fully-configurable/variables.tf +++ b/solutions/fully-configurable/variables.tf @@ -8,7 +8,7 @@ locals { variable "prefix" { type = string nullable = true - 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 can not contain consecutive hyphens ('--'). Example: prod-0205-ocpai. [Learn more](https://terraform-ibm-modules.github.io/documentation/#/prefix.md)." + 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)." validation { # - null and empty string is allowed diff --git a/solutions/quickstart/variables.tf b/solutions/quickstart/variables.tf index 59c2aef..95e8fe6 100644 --- a/solutions/quickstart/variables.tf +++ b/solutions/quickstart/variables.tf @@ -26,7 +26,7 @@ variable "provider_visibility" { variable "prefix" { type = string nullable = true - 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 can not contain consecutive hyphens ('--'). Example: prod-0205-ocpai. [Learn more](https://terraform-ibm-modules.github.io/documentation/#/prefix.md)." + 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)." validation { # - null and empty string is allowed From 248f5f98278dd9916bbb0c148c9cbd6a13a29636 Mon Sep 17 00:00:00 2001 From: Aditya-ranjan-16 Date: Wed, 22 Oct 2025 15:14:49 +0530 Subject: [PATCH 3/3] update catalog --- ibm_catalog.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ibm_catalog.json b/ibm_catalog.json index 9004e3a..b30b16a 100644 --- a/ibm_catalog.json +++ b/ibm_catalog.json @@ -245,6 +245,10 @@ { "key": "prefix", "required": true, + "default_value": "dev", + "random_string": { + "length": 4 + }, "value_constraints": [ { "type": "regex", @@ -755,6 +759,10 @@ { "key": "prefix", "required": true, + "default_value": "dev", + "random_string": { + "length": 4 + }, "value_constraints": [ { "type": "regex",