Skip to content

Commit 408fe3c

Browse files
feat: Add Project UI regex validation for the DA (#373)
1 parent 028ea4a commit 408fe3c

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

ibm_catalog.json

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,14 @@
102102
},
103103
{
104104
"key": "prefix",
105-
"required": true
105+
"required": true,
106+
"value_constraints": [
107+
{
108+
"type": "regex",
109+
"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.",
110+
"value": "^$|^__NULL__$|^[a-z](?!.*--)(?:[a-z0-9-]{0,14}[a-z0-9])?$"
111+
}
112+
]
106113
},
107114
{
108115
"key": "provider_visibility",
@@ -371,7 +378,14 @@
371378
},
372379
{
373380
"key": "prefix",
374-
"required": true
381+
"required": true,
382+
"value_constraints": [
383+
{
384+
"type": "regex",
385+
"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.",
386+
"value": "^$|^__NULL__$|^[a-z](?!.*--)(?:[a-z0-9-]{0,14}[a-z0-9])?$"
387+
}
388+
]
375389
},
376390
{
377391
"key": "skip_iam_account_settings",

solutions/fully-configurable/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ variable "provider_visibility" {
2222
variable "prefix" {
2323
type = string
2424
nullable = true
25-
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-us-south. [Learn more](https://terraform-ibm-modules.github.io/documentation/#/prefix.md)."
25+
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)."
2626

2727
validation {
2828
# - null and empty string is allowed

0 commit comments

Comments
 (0)