Skip to content

Commit 9e53940

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" (#694)
Co-authored-by: shemau <shemau@gmail.com>
1 parent 988f3bb commit 9e53940

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
@@ -132,12 +132,22 @@
132132
"config_constraints": {
133133
"identifier": "rg_name"
134134
}
135-
},
136-
"default_value": "Default",
137-
"description": "The name of an existing resource group to provision the resources."
135+
}
138136
},
139137
{
140-
"key": "prefix"
138+
"key": "prefix",
139+
"required": true,
140+
"default_value": "dev",
141+
"random_string": {
142+
"length": 4
143+
},
144+
"value_constraints": [
145+
{
146+
"type": "regex",
147+
"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.",
148+
"value": "^$|^__NULL__$|^[a-z](?!.*--)(?:[a-z0-9-]{0,14}[a-z0-9])?$"
149+
}
150+
]
141151
},
142152
{
143153
"key": "region",
@@ -456,12 +466,22 @@
456466
"config_constraints": {
457467
"identifier": "rg_name"
458468
}
459-
},
460-
"default_value": "Default",
461-
"description": "The name of an existing resource group to provision the resources."
469+
}
462470
},
463471
{
464-
"key": "prefix"
472+
"key": "prefix",
473+
"required": true,
474+
"default_value": "dev",
475+
"random_string": {
476+
"length": 4
477+
},
478+
"value_constraints": [
479+
{
480+
"type": "regex",
481+
"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.",
482+
"value": "^$|^__NULL__$|^[a-z](?!.*--)(?:[a-z0-9-]{0,14}[a-z0-9])?$"
483+
}
484+
]
465485
},
466486
{
467487
"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)