diff --git a/solutions/fully-configurable/variables.tf b/solutions/fully-configurable/variables.tf index 00ff649c..1cf9f90e 100644 --- a/solutions/fully-configurable/variables.tf +++ b/solutions/fully-configurable/variables.tf @@ -10,9 +10,8 @@ variable "ibmcloud_api_key" { variable "existing_resource_group_name" { type = string - description = "The name of an existing resource group to provision resource in." - default = "Default" - nullable = false + description = "The name of an existing resource group to provision the resources. If not provided the default resource group will be used." + default = null } variable "prefix" { diff --git a/solutions/security-enforced/variables.tf b/solutions/security-enforced/variables.tf index ac4aaf4d..f17b145f 100644 --- a/solutions/security-enforced/variables.tf +++ b/solutions/security-enforced/variables.tf @@ -10,9 +10,8 @@ variable "ibmcloud_api_key" { variable "existing_resource_group_name" { type = string - description = "The name of an existing resource group to provision resource in." - default = "Default" - nullable = false + description = "The name of an existing resource group to provision the resources. If not provided the default resource group will be used." + default = null } variable "prefix" { diff --git a/tests/pr_test.go b/tests/pr_test.go index d59a6615..4b25e650 100644 --- a/tests/pr_test.go +++ b/tests/pr_test.go @@ -122,6 +122,8 @@ func TestRunSecurityEnforcedSolutionSchematics(t *testing.T) { WaitJobCompleteMinutes: 60, }) + uniqueResourceGroup := generateUniqueResourceGroupName(options.Prefix) + options.TerraformVars = []testschematic.TestSchematicTerraformVar{ {Name: "prefix", Value: options.Prefix, DataType: "string", Secure: true}, {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) { {Name: "existing_kms_instance_crn", Value: permanentResources["hpcs_south_crn"], DataType: "string"}, {Name: "existing_backup_kms_key_crn", Value: permanentResources["hpcs_south_root_key_crn"], DataType: "string"}, {Name: "postgresql_version", Value: "16", DataType: "string"}, // Always lock this test into the latest supported PostgresSQL version - {Name: "existing_resource_group_name", Value: "geretain-test-postgres-security-enforced", DataType: "string"}, + {Name: "existing_resource_group_name", Value: uniqueResourceGroup, DataType: "string"}, {Name: "admin_pass", Value: GetRandomAdminPassword(t), DataType: "string"}, } - err := options.RunSchematicTest() + err := sharedInfoSvc.WithNewResourceGroup(uniqueResourceGroup, func() error { + return options.RunSchematicTest() + }) assert.Nil(t, err, "This should not have errored") }