Skip to content

Commit 84ea949

Browse files
arya-girish-kArya Girish K
andauthored
feat: Add Project UI regex validation for the DA (#319)
* feat: Add regex validation * fix: updated regex for monitoring crn * fix: Resolved typo error * fix: Resolved precommit error --------- Co-authored-by: Arya Girish K <[email protected]>
1 parent 544d47d commit 84ea949

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
@@ -228,7 +228,14 @@
228228
},
229229
{
230230
"key": "prefix",
231-
"required": true
231+
"required": true,
232+
"value_constraints": [
233+
{
234+
"type": "regex",
235+
"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.",
236+
"value": "^$|^__NULL__$|^[a-z](?!.*--)(?:[a-z0-9-]{0,14}[a-z0-9])?$"
237+
}
238+
]
232239
},
233240
{
234241
"key": "region",
@@ -296,7 +303,14 @@
296303
},
297304
{
298305
"key": "app_config_crn",
299-
"required": true
306+
"required": true,
307+
"value_constraints": [
308+
{
309+
"type": "regex",
310+
"description": "The value provided for 'app_config_crn' is not valid.",
311+
"value": "^__NULL__$|^crn:(.*:){3}apprapp:(.*:){2}[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}::$"
312+
}
313+
]
300314
},
301315
{
302316
"key": "app_config_plan",
@@ -415,7 +429,14 @@
415429
]
416430
},
417431
{
418-
"key": "existing_monitoring_crn"
432+
"key": "existing_monitoring_crn",
433+
"value_constraints": [
434+
{
435+
"type": "regex",
436+
"description": "The value provided for 'existing_monitoring_crn' is not valid.",
437+
"value": "^__NULL__$|^crn:(.*:){3}sysdig-monitor:(.*:){2}[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}::$"
438+
}
439+
]
419440
},
420441
{
421442
"key": "scc_workload_protection_instance_name"

solutions/fully-configurable/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ variable "existing_monitoring_crn" {
3232
variable "prefix" {
3333
type = string
3434
nullable = true
35-
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-wp. [Learn more](https://terraform-ibm-modules.github.io/documentation/#/prefix.md)."
35+
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)."
3636

3737
validation {
3838
# - null and empty string is allowed

0 commit comments

Comments
 (0)