Skip to content

Commit 0eee7f7

Browse files
authored
fix: Align terraform input values with catalog manifest values and update tests (#367)
1 parent 308023b commit 0eee7f7

File tree

5 files changed

+9
-12
lines changed

5 files changed

+9
-12
lines changed

cra-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ CRA_TARGETS:
55
CRA_IGNORE_RULES_FILE: "cra-tf-validate-ignore-rules.json"
66
PROFILE_ID: "fe96bd4d-9b37-40f2-b39f-a62760e326a3" # SCC profile ID (currently set to 'IBM Cloud Framework for Financial Services' '1.7.0' profile).
77
CRA_ENVIRONMENT_VARIABLES:
8-
TF_VAR_resource_group_name: "test"
8+
TF_VAR_resource_group_name: "Default"
99
TF_VAR_prefix: "test"
1010
TF_VAR_existing_kms_instance_crn: "crn:v1:bluemix:public:hs-crypto:us-south:a/abac0df06b644a9cabc6e44f55b3880e:e6dce284-e80f-46e1-a3c1-830f7adff7a9::"
1111
TF_VAR_provider_visibility: "public"

ibm_catalog.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@
119119
"key": "resource_group_name",
120120
"display_name": "resource_group",
121121
"required": false,
122-
"default_value": "Default",
123122
"custom_config": {
124123
"type": "resource_group",
125124
"grouping": "deployment",
@@ -131,8 +130,7 @@
131130
},
132131
{
133132
"key": "use_existing_resource_group",
134-
"hidden": true,
135-
"default_value": true
133+
"hidden": true
136134
},
137135
{
138136
"custom_config": {

solutions/instances/catalogValidationValues.json.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"ibmcloud_api_key": $VALIDATION_APIKEY,
3-
"resource_group_name": $PREFIX,
3+
"resource_group_name": "geretain-test-observability-instances",
44
"existing_kms_instance_crn": $HPCS_US_SOUTH_CRN,
55
"region": "us-south",
66
"prefix": $PREFIX,

solutions/instances/variables.tf

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,14 @@ variable "ibmcloud_cos_api_key" {
2424

2525
variable "use_existing_resource_group" {
2626
type = bool
27-
description = "Whether to use an existing resource group."
28-
default = false
27+
description = "Whether to use an existing resource group. Use the `resource_group_name` input to define the group."
28+
default = true
2929
}
3030

3131
variable "resource_group_name" {
3232
type = string
33-
description = "The name of a new or existing resource group to provision resources in."
33+
description = "The name of the resource group to provision resources in."
34+
default = "Default"
3435
}
3536

3637
variable "cos_resource_group_name" {

tests/pr_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func TestInstancesInSchematics(t *testing.T) {
8989

9090
options.TerraformVars = []testschematic.TestSchematicTerraformVar{
9191
{Name: "ibmcloud_api_key", Value: options.RequiredEnvironmentVars["TF_VAR_ibmcloud_api_key"], DataType: "string", Secure: true},
92-
{Name: "resource_group_name", Value: options.Prefix, DataType: "string"},
92+
{Name: "resource_group_name", Value: resourceGroup, DataType: "string"},
9393
{Name: "existing_kms_instance_crn", Value: permanentResources["hpcs_south_crn"], DataType: "string"},
9494
{Name: "cos_region", Value: region, DataType: "string"},
9595
{Name: "cos_instance_tags", Value: options.Tags, DataType: "list(string)"},
@@ -123,7 +123,7 @@ func TestRunUpgradeSolutionInstances(t *testing.T) {
123123

124124
options.TerraformVars = map[string]interface{}{
125125
"prefix": options.Prefix,
126-
"resource_group_name": options.Prefix,
126+
"resource_group_name": resourceGroup,
127127
"cos_instance_access_tags": permanentResources["accessTags"],
128128
"existing_kms_instance_crn": permanentResources["hpcs_south_crn"],
129129
"kms_endpoint_type": "public",
@@ -313,7 +313,6 @@ func TestRunExistingResourcesInstancesSchematics(t *testing.T) {
313313
{Name: "region", Value: region, DataType: "string"},
314314
{Name: "cos_region", Value: region, DataType: "string"},
315315
{Name: "resource_group_name", Value: terraform.Output(t, existingTerraformOptions, "resource_group_name"), DataType: "string"},
316-
{Name: "use_existing_resource_group", Value: true, DataType: "bool"},
317316
{Name: "existing_cloud_logs_data_bucket_crn", Value: terraform.Output(t, existingTerraformOptions, "data_bucket_crn"), DataType: "string"},
318317
{Name: "existing_at_cos_target_bucket_name", Value: terraform.Output(t, existingTerraformOptions, "bucket_name_at"), DataType: "string"},
319318
{Name: "existing_at_cos_target_bucket_endpoint", Value: terraform.Output(t, existingTerraformOptions, "bucket_endpoint_at"), DataType: "string"},
@@ -357,7 +356,6 @@ func TestRunExistingResourcesInstancesSchematics(t *testing.T) {
357356
{Name: "cos_region", Value: region, DataType: "string"},
358357
{Name: "prefix", Value: options2.Prefix, DataType: "string"},
359358
{Name: "resource_group_name", Value: terraform.Output(t, existingTerraformOptions, "resource_group_name"), DataType: "string"},
360-
{Name: "use_existing_resource_group", Value: true, DataType: "bool"},
361359
{Name: "kms_endpoint_type", Value: "private", DataType: "string"},
362360
{Name: "existing_cos_instance_crn", Value: terraform.Output(t, existingTerraformOptions, "cos_crn"), DataType: "string"},
363361
{Name: "management_endpoint_type_for_bucket", Value: "private", DataType: "string"},

0 commit comments

Comments
 (0)