Skip to content

Commit 5c2402b

Browse files
ocofaighshemau
andauthored
feat: DA updates:<br>- add default value for prefix using random string generator<br>- Updated the default value of existing_resource_group_name to be "Default" (#486)
Co-authored-by: shemau <shemau@gmail.com>
1 parent a3935c4 commit 5c2402b

File tree

3 files changed

+34
-14
lines changed

3 files changed

+34
-14
lines changed

ibm_catalog.json

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,22 @@
131131
"config_constraints": {
132132
"identifier": "rg_name"
133133
}
134-
},
135-
"default_value": "Default",
136-
"description": "The name of an existing resource group to provision the resources."
134+
}
137135
},
138136
{
139-
"key": "prefix"
137+
"key": "prefix",
138+
"required": true,
139+
"default_value": "dev",
140+
"random_string": {
141+
"length": 4
142+
},
143+
"value_constraints": [
144+
{
145+
"type": "regex",
146+
"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.",
147+
"value": "^$|^__NULL__$|^[a-z](?!.*--)(?:[a-z0-9-]{0,14}[a-z0-9])?$"
148+
}
149+
]
140150
},
141151
{
142152
"key": "region",
@@ -474,12 +484,22 @@
474484
"config_constraints": {
475485
"identifier": "rg_name"
476486
}
477-
},
478-
"default_value": "Default",
479-
"description": "The name of an existing resource group to provision the resources."
487+
}
480488
},
481489
{
482-
"key": "prefix"
490+
"key": "prefix",
491+
"required": true,
492+
"default_value": "dev",
493+
"random_string": {
494+
"length": 4
495+
},
496+
"value_constraints": [
497+
{
498+
"type": "regex",
499+
"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.",
500+
"value": "^$|^__NULL__$|^[a-z](?!.*--)(?:[a-z0-9-]{0,14}[a-z0-9])?$"
501+
}
502+
]
483503
},
484504
{
485505
"key": "region",

solutions/fully-configurable/variables.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ variable "ibmcloud_api_key" {
1010

1111
variable "existing_resource_group_name" {
1212
type = string
13-
description = "The name of an existing resource group to provision the resources. If not provided the default resource group will be used."
14-
default = null
13+
description = "The name of an existing resource group to provision the resources. [Learn more](https://cloud.ibm.com/docs/account?topic=account-rgs&interface=ui#create_rgs) about how to create a resource group."
14+
default = "Default"
1515
}
1616

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: prod-0205-cos. [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
# - null and empty string is allowed

solutions/security-enforced/variables.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ variable "ibmcloud_api_key" {
1010

1111
variable "existing_resource_group_name" {
1212
type = string
13-
description = "The name of an existing resource group to provision the resources. If not provided the default resource group will be used."
14-
default = null
13+
description = "The name of an existing resource group to provision the resources. [Learn more](https://cloud.ibm.com/docs/account?topic=account-rgs&interface=ui#create_rgs) about how to create a resource group."
14+
default = "Default"
1515
}
1616

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: prod-0205-cos. [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
# - null and empty string is allowed

0 commit comments

Comments
 (0)