Skip to content

Commit eb91e2f

Browse files
feat: Add regex UI validation to the DA (#476)
1 parent 5fe1682 commit eb91e2f

File tree

3 files changed

+36
-6
lines changed

3 files changed

+36
-6
lines changed

ibm_catalog.json

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,14 @@
252252
"hidden": true
253253
},
254254
{
255-
"key": "existing_secrets_manager_instance_crn"
255+
"key": "existing_secrets_manager_instance_crn",
256+
"value_constraints": [
257+
{
258+
"type": "regex",
259+
"description": "The value provided for 'existing_secrets_manager_instance_crn' is not valid.",
260+
"value": "^__NULL__$|^crn:(.*:){3}secrets-manager:(.*:){2}[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}::$"
261+
}
262+
]
256263
},
257264
{
258265
"key": "service_credential_secrets",
@@ -687,10 +694,24 @@
687694
"key": "ibmcloud_kms_api_key"
688695
},
689696
{
690-
"key": "existing_kms_key_crn"
697+
"key": "existing_kms_key_crn",
698+
"value_constraints": [
699+
{
700+
"type": "regex",
701+
"description": "The value provided for 'existing_kms_key_crn' is not valid.",
702+
"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-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"
703+
}
704+
]
691705
},
692706
{
693-
"key": "existing_kms_instance_crn"
707+
"key": "existing_kms_instance_crn",
708+
"value_constraints": [
709+
{
710+
"type": "regex",
711+
"description": "The value provided for 'existing_kms_instance_crn' is not valid.",
712+
"value": "^__NULL__$|^crn:(.*:){3}(kms|hs-crypto):(.*:){2}[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}::$"
713+
}
714+
]
694715
},
695716
{
696717
"key": "kms_key_name"
@@ -733,7 +754,14 @@
733754
"hidden": true
734755
},
735756
{
736-
"key": "existing_secrets_manager_instance_crn"
757+
"key": "existing_secrets_manager_instance_crn",
758+
"value_constraints": [
759+
{
760+
"type": "regex",
761+
"description": "The value provided for 'existing_secrets_manager_instance_crn' is not valid.",
762+
"value": "^__NULL__$|^crn:(.*:){3}secrets-manager:(.*:){2}[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}::$"
763+
}
764+
]
737765
},
738766
{
739767
"key": "service_credential_secrets",

solutions/quickstart/variables.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ variable "region" {
3333

3434
variable "prefix" {
3535
type = string
36-
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-es. [Learn more](https://terraform-ibm-modules.github.io/documentation/#/prefix)."
36+
nullable = true
37+
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)."
3738

3839
validation {
3940
condition = (var.prefix == null || var.prefix == "" ? true :

solutions/security-enforced/variables.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ variable "region" {
2222

2323
variable "prefix" {
2424
type = string
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-0205-es. [Learn more](https://terraform-ibm-modules.github.io/documentation/#/prefix)."
25+
nullable = true
26+
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)."
2627

2728
validation {
2829
condition = (var.prefix == null || var.prefix == "" ? true :

0 commit comments

Comments
 (0)