Skip to content

Commit 27ec670

Browse files
authored
feat: Add Project UI regex validation for the DA (#97)
1 parent 0b2c04d commit 27ec670

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
@@ -49,7 +49,14 @@
4949
},
5050
{
5151
"key": "prefix",
52-
"required": true
52+
"required": true,
53+
"value_constraints": [
54+
{
55+
"type": "regex",
56+
"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.",
57+
"value": "^$|^__NULL__$|^[a-z](?!.*--)(?:[a-z0-9-]{0,14}[a-z0-9])?$"
58+
}
59+
]
5360
},
5461
{
5562
"key": "existing_resource_group_name",
@@ -179,7 +186,14 @@
179186
"required": true
180187
},
181188
{
182-
"key": "existing_cloud_monitoring_crn"
189+
"key": "existing_cloud_monitoring_crn",
190+
"value_constraints": [
191+
{
192+
"type": "regex",
193+
"description": "The value provided for 'existing_cloud_monitoring_crn' is not valid.",
194+
"value": "^__NULL__$|^crn:(.*:){3}sysdig-monitor:(.*:){2}[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}::$"
195+
}
196+
]
183197
},
184198
{
185199
"key": "enable_metrics_routing_to_cloud_monitoring"

solutions/fully-configurable/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ variable "existing_resource_group_name" {
1717
variable "prefix" {
1818
type = string
1919
nullable = true
20-
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: cl-02. [Learn more](https://terraform-ibm-modules.github.io/documentation/#/prefix.md)"
20+
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)."
2121

2222
validation {
2323
condition = var.prefix == null || var.prefix == "" ? true : alltrue([

0 commit comments

Comments
 (0)