Skip to content

Commit 1533ff1

Browse files
authored
feat: Add Project UI regex validation for the DA (#290)
1 parent 0b4c86f commit 1533ff1

File tree

2 files changed

+33
-5
lines changed

2 files changed

+33
-5
lines changed

ibm_catalog.json

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,14 @@
6666
},
6767
{
6868
"key": "prefix",
69-
"required": true
69+
"required": true,
70+
"value_constraints": [
71+
{
72+
"type": "regex",
73+
"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.",
74+
"value": "^$|^__NULL__$|^[a-z](?!.*--)(?:[a-z0-9-]{0,14}[a-z0-9])?$"
75+
}
76+
]
7077
},
7178
{
7279
"key": "region",
@@ -270,10 +277,24 @@
270277
"key": "ibmcloud_kms_api_key"
271278
},
272279
{
273-
"key": "existing_kms_instance_crn"
280+
"key": "existing_kms_instance_crn",
281+
"value_constraints": [
282+
{
283+
"type": "regex",
284+
"description": "The value provided for 'existing_kms_instance_crn' is not valid.",
285+
"value": "^__NULL__$|^crn:(.*:){3}(kms|hs-crypto):(.*:){2}[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}::$"
286+
}
287+
]
274288
},
275289
{
276-
"key": "existing_kms_key_crn"
290+
"key": "existing_kms_key_crn",
291+
"value_constraints": [
292+
{
293+
"type": "regex",
294+
"description": "The value provided for 'existing_kms_key_crn' is not valid.",
295+
"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}$"
296+
}
297+
]
277298
},
278299
{
279300
"key": "kms_endpoint_type",
@@ -305,7 +326,14 @@
305326
"key": "skip_app_config_event_notifications_auth_policy"
306327
},
307328
{
308-
"key": "existing_event_notifications_instance_crn"
329+
"key": "existing_event_notifications_instance_crn",
330+
"value_constraints": [
331+
{
332+
"type": "regex",
333+
"description": "The value provided for 'existing_event_notifications_instance_crn' is not valid.",
334+
"value": "^__NULL__$|^crn:(.*:){3}event-notifications:(.*:){2}[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}::$"
335+
}
336+
]
309337
},
310338
{
311339
"key": "event_notifications_endpoint_url"

solutions/fully-configurable/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ variable "existing_resource_group_name" {
2929
variable "prefix" {
3030
type = string
3131
nullable = true
32-
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)."
32+
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)."
3333

3434
validation {
3535
# - null and empty string is allowed

0 commit comments

Comments
 (0)