From 930ac901fe6caff2ce8f7bb2da194cac84370761 Mon Sep 17 00:00:00 2001 From: Md Anam Raihan Date: Sun, 21 Sep 2025 01:17:39 +0530 Subject: [PATCH 1/3] feat: added regex validation to DA inputs --- ibm_catalog.json | 45 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/ibm_catalog.json b/ibm_catalog.json index a287742..632d3a5 100644 --- a/ibm_catalog.json +++ b/ibm_catalog.json @@ -108,7 +108,14 @@ }, { "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", @@ -160,7 +167,14 @@ ] }, { - "key": "existing_cloud_logs_instance_crn" + "key": "existing_cloud_logs_instance_crn", + "value_constraints": [ + { + "type": "regex", + "description": "The value provided for 'existing_cloud_logs_instance_crn' is not valid.", + "value": "^__NULL__$|^crn:(.*:){3}logs:(.*:){2}[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}::$" + } + ] }, { "key": "enable_activity_tracker_event_routing_to_cloud_logs" @@ -172,7 +186,14 @@ "key": "activity_tracker_cloud_logs_route_name" }, { - "key": "existing_cos_instance_crn" + "key": "existing_cos_instance_crn", + "value_constraints": [ + { + "type": "regex", + "description": "The value provided for 'existing_cos_instance_crn' is not valid.", + "value": "^__NULL__$|^crn:(.*:){3}cloud-object-storage:(.*:){2}[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}::$" + } + ] }, { "key": "ibmcloud_cos_api_key" @@ -260,13 +281,27 @@ "key": "kms_encryption_enabled_buckets" }, { - "key": "existing_cos_kms_key_crn" + "key": "existing_cos_kms_key_crn", + "value_constraints": [ + { + "type": "regex", + "description": "The value provided for 'existing_cos_kms_key_crn' in not valid.", + "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}$" + } + ] }, { "key": "existing_monitoring_crn" }, { - "key": "existing_kms_instance_crn" + "key": "existing_kms_instance_crn", + "value_constraints": [ + { + "type": "regex", + "description": "The value provided for 'existing_kms_instance_crn' is not valid.", + "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": "cos_key_name" From b398dc5b4dcdd8b576a72b3b59a79ff92920153e Mon Sep 17 00:00:00 2001 From: Md Anam Raihan Date: Tue, 23 Sep 2025 18:48:06 +0530 Subject: [PATCH 2/3] add cloud monitoring regex --- ibm_catalog.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ibm_catalog.json b/ibm_catalog.json index 632d3a5..ecce8e5 100644 --- a/ibm_catalog.json +++ b/ibm_catalog.json @@ -291,7 +291,14 @@ ] }, { - "key": "existing_monitoring_crn" + "key": "existing_monitoring_crn", + "value_constraints": [ + { + "type": "regex", + "description": "The value provided for 'existing_monitoring_crn' in not valid.", + "value": "^__NULL__$|^crn:(.*:){3}sysdig-monitor:(.*:){2}[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}::$" + } + ] }, { "key": "existing_kms_instance_crn", From 281038166309ccf874b5a3a2e3a707e593781d09 Mon Sep 17 00:00:00 2001 From: Md Anam Raihan Date: Thu, 25 Sep 2025 14:50:51 +0530 Subject: [PATCH 3/3] update description and grammer --- ibm_catalog.json | 6 +++--- solutions/fully-configurable/variables.tf | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ibm_catalog.json b/ibm_catalog.json index ebf90a9..d3a328d 100644 --- a/ibm_catalog.json +++ b/ibm_catalog.json @@ -112,7 +112,7 @@ "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", + "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])?$" } ] @@ -285,7 +285,7 @@ "value_constraints": [ { "type": "regex", - "description": "The value provided for 'existing_cos_kms_key_crn' in not valid.", + "description": "The value provided for 'existing_cos_kms_key_crn' is not valid.", "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}$" } ] @@ -295,7 +295,7 @@ "value_constraints": [ { "type": "regex", - "description": "The value provided for 'existing_monitoring_crn' in not valid.", + "description": "The value provided for 'existing_monitoring_crn' is not valid.", "value": "^__NULL__$|^crn:(.*:){3}sysdig-monitor:(.*:){2}[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}::$" } ] diff --git a/solutions/fully-configurable/variables.tf b/solutions/fully-configurable/variables.tf index bb7bc5b..63e7451 100644 --- a/solutions/fully-configurable/variables.tf +++ b/solutions/fully-configurable/variables.tf @@ -31,7 +31,7 @@ variable "region" { 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: at-0312. [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