Skip to content

Commit 3a11488

Browse files
authored
fix: The default value of existing_resource_group_name is now null, which means it will default to the default resource group in your account. Previously it was defaulting to "Default" which may not exist in every account. (#700)
1 parent c999658 commit 3a11488

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

solutions/fully-configurable/variables.tf

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ 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 resource in."
14-
default = "Default"
15-
nullable = false
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
1615
}
1716

1817
variable "prefix" {

solutions/security-enforced/variables.tf

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ 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 resource in."
14-
default = "Default"
15-
nullable = false
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
1615
}
1716

1817
variable "prefix" {

tests/pr_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ func TestRunSecurityEnforcedSolutionSchematics(t *testing.T) {
122122
WaitJobCompleteMinutes: 60,
123123
})
124124

125+
uniqueResourceGroup := generateUniqueResourceGroupName(options.Prefix)
126+
125127
options.TerraformVars = []testschematic.TestSchematicTerraformVar{
126128
{Name: "prefix", Value: options.Prefix, DataType: "string", Secure: true},
127129
{Name: "ibmcloud_api_key", Value: options.RequiredEnvironmentVars["TF_VAR_ibmcloud_api_key"], DataType: "string", Secure: true},
@@ -130,10 +132,12 @@ func TestRunSecurityEnforcedSolutionSchematics(t *testing.T) {
130132
{Name: "existing_kms_instance_crn", Value: permanentResources["hpcs_south_crn"], DataType: "string"},
131133
{Name: "existing_backup_kms_key_crn", Value: permanentResources["hpcs_south_root_key_crn"], DataType: "string"},
132134
{Name: "postgresql_version", Value: "16", DataType: "string"}, // Always lock this test into the latest supported PostgresSQL version
133-
{Name: "existing_resource_group_name", Value: "geretain-test-postgres-security-enforced", DataType: "string"},
135+
{Name: "existing_resource_group_name", Value: uniqueResourceGroup, DataType: "string"},
134136
{Name: "admin_pass", Value: GetRandomAdminPassword(t), DataType: "string"},
135137
}
136-
err := options.RunSchematicTest()
138+
err := sharedInfoSvc.WithNewResourceGroup(uniqueResourceGroup, func() error {
139+
return options.RunSchematicTest()
140+
})
137141
assert.Nil(t, err, "This should not have errored")
138142
}
139143

0 commit comments

Comments
 (0)