From e2d534563fd48d4002a2b9a91b4f7efa2ce3c8d4 Mon Sep 17 00:00:00 2001 From: Aditya Ranjan <48973656+Aditya-ranjan-16@users.noreply.github.com> Date: Wed, 11 Dec 2024 19:02:46 +0530 Subject: [PATCH] fix: reverted the ability to set the `provider_visibility` in DA" due to known provider bug (#930) --- cra-config.yaml | 3 - ibm_catalog.json | 102 -------------------------- patterns/roks-quickstart/provider.tf | 1 - patterns/roks-quickstart/variables.tf | 9 --- patterns/roks/main.tf | 1 - patterns/roks/variables.tf | 10 +-- patterns/vpc/main.tf | 1 - patterns/vpc/variables.tf | 10 +-- patterns/vsi-extension/provider.tf | 1 - patterns/vsi-extension/variables.tf | 9 --- patterns/vsi-quickstart/provider.tf | 1 - patterns/vsi-quickstart/variables.tf | 10 --- patterns/vsi/main.tf | 1 - patterns/vsi/variables.tf | 10 +-- tests/other_test.go | 2 - tests/pr_test.go | 21 ++---- 16 files changed, 10 insertions(+), 182 deletions(-) diff --git a/cra-config.yaml b/cra-config.yaml index 1ee943294..557eade6c 100644 --- a/cra-config.yaml +++ b/cra-config.yaml @@ -7,7 +7,6 @@ CRA_TARGETS: CRA_ENVIRONMENT_VARIABLES: TF_VAR_prefix: "slz-vpc" TF_VAR_region: "us-south" - TF_VAR_provider_visibility: "public" - CRA_TARGET: "patterns/vsi" CRA_IGNORE_RULES_FILE: "cra-tf-validate-ignore-rules.json" PROFILE_ID: "fe96bd4d-9b37-40f2-b39f-a62760e326a3" # SCC profile ID (currently set to 'IBM Cloud Framework for Financial Services' '1.7.0' profile). @@ -15,11 +14,9 @@ CRA_TARGETS: TF_VAR_prefix: "slz-vsi" TF_VAR_region: "us-south" TF_VAR_ssh_public_key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC/hfNI5cNjimtcVgNA1acGmi1iv7PTjKcF8D+8DqffkGMsY6vU7KtB1mASwVU8GMGLzU2qvGmXwHSANYqPOraEitgI06zhq5VXVvtjOR41IJjP+ssjHIbql+EDzls2yJuZd2g4Wmk5NKTzJFNYsvIaCGUYCSMUPT9bepUqIOyjsrCEiHGLaphF5W2V/hj1+1NEZqV3ozhmHmtff2tIb6+VQpd/dl61RKuF74rywd1krmBOe4kbPzfYRqiRKV0rl0bPuyL+FV3Zv5gdzRRLNQiOxapv9uSkCal3W0umpSQyBYtj6BhGxeKrBKVgXgdq7byStRFSlREaKIg+tkekieqNZbBArgSYoNACZilxrzzC6u0KuWtllldy1CwCtFEdBlSPnHwnD/XhAs6FVuoh5tmw+FLtVyg8UyMgSvVr1Vcya9uAOCLLiihsgAB5xqqcJaXcfk+zkWn7rUJ9F+R3CZs9rgEvBbHpFAKJqcMsInZ+G0Jt0s6kIpAPr/plcfrK2bcwG/L9Kbuedf31dmHAylKqfMpdqm2YoSXOs5Y7Wh6KV/1VhL/u0++hxGt6APjvpY0BTlvsw7fmBSPniHkC8fF6bEzP0blCRcI3SB7P/glrZqM5UptBoEI5a8LBv5G4YsVolRepj6FjwlPvfgBbLF5AXxFtZTk07UW7CRauO5xbJw==" - TF_VAR_provider_visibility: "public" - CRA_TARGET: "patterns/roks" CRA_IGNORE_RULES_FILE: "cra-tf-validate-ignore-rules.json" PROFILE_ID: "fe96bd4d-9b37-40f2-b39f-a62760e326a3" # SCC profile ID (currently set to 'IBM Cloud Framework for Financial Services' '1.7.0' profile). CRA_ENVIRONMENT_VARIABLES: TF_VAR_prefix: "slz-roks" TF_VAR_region: "us-south" - TF_VAR_provider_visibility: "public" diff --git a/ibm_catalog.json b/ibm_catalog.json index 9a2ed83ee..e1c857be0 100644 --- a/ibm_catalog.json +++ b/ibm_catalog.json @@ -66,23 +66,6 @@ }, "key": "override_json_string" }, - { - "key": "provider_visibility", - "options": [ - { - "displayname": "private", - "value": "private" - }, - { - "displayname": "public", - "value": "public" - }, - { - "displayname": "public-and-private", - "value": "public-and-private" - } - ] - }, { "custom_config": { "config_constraints": { @@ -212,23 +195,6 @@ "key": "ssh_public_key", "required": true }, - { - "key": "provider_visibility", - "options": [ - { - "displayname": "private", - "value": "private" - }, - { - "displayname": "public", - "value": "public" - }, - { - "displayname": "public-and-private", - "value": "public-and-private" - } - ] - }, { "hidden": true, "key": "teleport_domain" @@ -567,23 +533,6 @@ "key": "ssh_public_key", "required": true }, - { - "key": "provider_visibility", - "options": [ - { - "displayname": "private", - "value": "private" - }, - { - "displayname": "public", - "value": "public" - }, - { - "displayname": "public-and-private", - "value": "public-and-private" - } - ] - }, { "custom_config": { "config_constraints": { @@ -723,23 +672,6 @@ "key": "region", "required": true }, - { - "key": "provider_visibility", - "options": [ - { - "displayname": "private", - "value": "private" - }, - { - "displayname": "public", - "value": "public" - }, - { - "displayname": "public-and-private", - "value": "public-and-private" - } - ] - }, { "key": "add_edge_vpc", "hidden": true @@ -1091,23 +1023,6 @@ "key": "region", "required": true, "type": "string" - }, - { - "key": "provider_visibility", - "options": [ - { - "displayname": "private", - "value": "private" - }, - { - "displayname": "public", - "value": "public" - }, - { - "displayname": "public-and-private", - "value": "public-and-private" - } - ] } ], "iam_permissions": [ @@ -1227,23 +1142,6 @@ ], "custom_config": {} }, - { - "key": "provider_visibility", - "options": [ - { - "displayname": "private", - "value": "private" - }, - { - "displayname": "public", - "value": "public" - }, - { - "displayname": "public-and-private", - "value": "public-and-private" - } - ] - }, { "hidden": true, "key": "tgactive_url" diff --git a/patterns/roks-quickstart/provider.tf b/patterns/roks-quickstart/provider.tf index f69fb6da2..df45ef50b 100644 --- a/patterns/roks-quickstart/provider.tf +++ b/patterns/roks-quickstart/provider.tf @@ -1,5 +1,4 @@ provider "ibm" { ibmcloud_api_key = var.ibmcloud_api_key region = var.region - visibility = var.provider_visibility } diff --git a/patterns/roks-quickstart/variables.tf b/patterns/roks-quickstart/variables.tf index adfeb3aa9..6c454c47a 100644 --- a/patterns/roks-quickstart/variables.tf +++ b/patterns/roks-quickstart/variables.tf @@ -8,15 +8,6 @@ variable "ibmcloud_api_key" { sensitive = true } -variable "provider_visibility" { - description = "Set the visibility value for the IBM terraform provider. Supported values are `public`, `private`, `public-and-private`. [Learn more](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/guides/custom-service-endpoints)." - type = string - default = "private" - validation { - condition = contains(["public", "private", "public-and-private"], var.provider_visibility) - error_message = "Invalid visibility option. Allowed values are 'public', 'private', or 'public-and-private'." - } -} variable "prefix" { description = "A unique identifier for resources that is prepended to resources that are provisioned. Must begin with a lowercase letter and end with a lowercase letter or number. Must be 13 or fewer characters." type = string diff --git a/patterns/roks/main.tf b/patterns/roks/main.tf index 526bb5192..209e4d7c9 100644 --- a/patterns/roks/main.tf +++ b/patterns/roks/main.tf @@ -6,7 +6,6 @@ provider "ibm" { ibmcloud_api_key = var.ibmcloud_api_key region = var.region ibmcloud_timeout = 60 - visibility = var.provider_visibility } ############################################################################## diff --git a/patterns/roks/variables.tf b/patterns/roks/variables.tf index c32998878..902a6cd78 100644 --- a/patterns/roks/variables.tf +++ b/patterns/roks/variables.tf @@ -7,15 +7,7 @@ variable "ibmcloud_api_key" { type = string sensitive = true } -variable "provider_visibility" { - description = "Set the visibility value for the IBM terraform provider. Supported values are `public`, `private`, `public-and-private`. [Learn more](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/guides/custom-service-endpoints)." - type = string - default = "private" - validation { - condition = contains(["public", "private", "public-and-private"], var.provider_visibility) - error_message = "Invalid visibility option. Allowed values are 'public', 'private', or 'public-and-private'." - } -} + variable "prefix" { description = "A unique identifier for resources that is prepended to resources that are provisioned. Must begin with a lowercase letter and end with a lowercase letter or number. Must be 13 or fewer characters." type = string diff --git a/patterns/vpc/main.tf b/patterns/vpc/main.tf index ed63c4fc0..fc0426da1 100644 --- a/patterns/vpc/main.tf +++ b/patterns/vpc/main.tf @@ -6,7 +6,6 @@ provider "ibm" { ibmcloud_api_key = var.ibmcloud_api_key region = var.region ibmcloud_timeout = 60 - visibility = var.provider_visibility } ############################################################################## diff --git a/patterns/vpc/variables.tf b/patterns/vpc/variables.tf index 240e07d5c..aced6c13f 100644 --- a/patterns/vpc/variables.tf +++ b/patterns/vpc/variables.tf @@ -7,15 +7,7 @@ variable "ibmcloud_api_key" { type = string sensitive = true } -variable "provider_visibility" { - description = "Set the visibility value for the IBM terraform provider. Supported values are `public`, `private`, `public-and-private`. [Learn more](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/guides/custom-service-endpoints)." - type = string - default = "private" - validation { - condition = contains(["public", "private", "public-and-private"], var.provider_visibility) - error_message = "Invalid visibility option. Allowed values are 'public', 'private', or 'public-and-private'." - } -} + variable "prefix" { description = "A unique identifier for resources that is prepended to resources that are provisioned. Must begin with a lowercase letter and end with a lowercase letter or number. Must be 16 or fewer characters." type = string diff --git a/patterns/vsi-extension/provider.tf b/patterns/vsi-extension/provider.tf index f69fb6da2..df45ef50b 100644 --- a/patterns/vsi-extension/provider.tf +++ b/patterns/vsi-extension/provider.tf @@ -1,5 +1,4 @@ provider "ibm" { ibmcloud_api_key = var.ibmcloud_api_key region = var.region - visibility = var.provider_visibility } diff --git a/patterns/vsi-extension/variables.tf b/patterns/vsi-extension/variables.tf index 52bd439c7..2609f8bef 100644 --- a/patterns/vsi-extension/variables.tf +++ b/patterns/vsi-extension/variables.tf @@ -3,16 +3,7 @@ variable "ibmcloud_api_key" { type = string sensitive = true } -variable "provider_visibility" { - description = "Set the visibility value for the IBM terraform provider. Supported values are `public`, `private`, `public-and-private`. [Learn more](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/guides/custom-service-endpoints)." - type = string - default = "private" - validation { - condition = contains(["public", "private", "public-and-private"], var.provider_visibility) - error_message = "Invalid visibility option. Allowed values are 'public', 'private', or 'public-and-private'." - } -} variable "region" { description = "The region of the landing zone VPC." type = string diff --git a/patterns/vsi-quickstart/provider.tf b/patterns/vsi-quickstart/provider.tf index f69fb6da2..df45ef50b 100644 --- a/patterns/vsi-quickstart/provider.tf +++ b/patterns/vsi-quickstart/provider.tf @@ -1,5 +1,4 @@ provider "ibm" { ibmcloud_api_key = var.ibmcloud_api_key region = var.region - visibility = var.provider_visibility } diff --git a/patterns/vsi-quickstart/variables.tf b/patterns/vsi-quickstart/variables.tf index 93b824567..259d68d62 100644 --- a/patterns/vsi-quickstart/variables.tf +++ b/patterns/vsi-quickstart/variables.tf @@ -8,16 +8,6 @@ variable "ibmcloud_api_key" { sensitive = true } -variable "provider_visibility" { - description = "Set the visibility value for the IBM terraform provider. Supported values are `public`, `private`, `public-and-private`. [Learn more](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/guides/custom-service-endpoints)." - type = string - default = "private" - - validation { - condition = contains(["public", "private", "public-and-private"], var.provider_visibility) - error_message = "Invalid visibility option. Allowed values are 'public', 'private', or 'public-and-private'." - } -} variable "prefix" { description = "A unique identifier for resources that is prepended to resources that are provisioned. Must begin with a lowercase letter and end with a lowercase letter or number. Must be 16 or fewer characters." type = string diff --git a/patterns/vsi/main.tf b/patterns/vsi/main.tf index c5eb31363..4087885ec 100644 --- a/patterns/vsi/main.tf +++ b/patterns/vsi/main.tf @@ -6,7 +6,6 @@ provider "ibm" { ibmcloud_api_key = var.ibmcloud_api_key region = var.region ibmcloud_timeout = 60 - visibility = var.provider_visibility } ############################################################################## diff --git a/patterns/vsi/variables.tf b/patterns/vsi/variables.tf index d9df22645..29e36176e 100644 --- a/patterns/vsi/variables.tf +++ b/patterns/vsi/variables.tf @@ -7,15 +7,7 @@ variable "ibmcloud_api_key" { type = string sensitive = true } -variable "provider_visibility" { - description = "Set the visibility value for the IBM terraform provider. Supported values are `public`, `private`, `public-and-private`. [Learn more](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/guides/custom-service-endpoints)." - type = string - default = "private" - validation { - condition = contains(["public", "private", "public-and-private"], var.provider_visibility) - error_message = "Invalid visibility option. Allowed values are 'public', 'private', or 'public-and-private'." - } -} + variable "prefix" { description = "A unique identifier for resources that is prepended to resources that are provisioned. Must begin with a lowercase letter and end with a lowercase letter or number. Must be 16 or fewer characters." type = string diff --git a/tests/other_test.go b/tests/other_test.go index 4c9cb65de..78e39558c 100644 --- a/tests/other_test.go +++ b/tests/other_test.go @@ -18,7 +18,6 @@ func TestRunRoksPatternWithHPCS(t *testing.T) { options.TerraformVars["hs_crypto_instance_name"] = permanentResources["hpcs_name_south"] options.TerraformVars["hs_crypto_resource_group"] = permanentResources["hpcs_rg_south"] options.TerraformVars["skip_kms_block_storage_s2s_auth_policy"] = true - options.TerraformVars["provider_visibility"] = "public" // If "jp-osa" was the best region selected, default to us-south instead. // "jp-osa" is currently not allowing hs-crypto be used for encrypting buckets in that region. currentRegion, ok := options.TerraformVars["region"] @@ -40,7 +39,6 @@ func TestRunVSIPatternWithHPCS(t *testing.T) { options.TerraformVars["hs_crypto_instance_name"] = permanentResources["hpcs_name_south"] options.TerraformVars["hs_crypto_resource_group"] = permanentResources["hpcs_rg_south"] options.TerraformVars["skip_kms_block_storage_s2s_auth_policy"] = true - options.TerraformVars["provider_visibility"] = "public" // If "jp-osa" was the best region selected, default to us-south instead. // "jp-osa" is currently not allowing hs-crypto be used for encrypting buckets in that region. currentRegion, ok := options.TerraformVars["region"] diff --git a/tests/pr_test.go b/tests/pr_test.go index e9c78f1bd..8dcaf39b9 100644 --- a/tests/pr_test.go +++ b/tests/pr_test.go @@ -76,8 +76,7 @@ func setupOptionsQuickStartPattern(t *testing.T, prefix string, dir string) *tes TerraformDir: dir, Prefix: prefix, TerraformVars: map[string]interface{}{ - "ssh_key": sshPublicKey, - "provider_visibility": "public", + "ssh_key": sshPublicKey, }, CloudInfoService: sharedInfoSvc, }) @@ -159,8 +158,7 @@ func setupOptionsROKSQuickStartPattern(t *testing.T, prefix string, dir string) Prefix: prefix, CloudInfoService: sharedInfoSvc, TerraformVars: map[string]interface{}{ - "entitlement": "cloud_pak", - "provider_visibility": "public", + "entitlement": "cloud_pak", }, }) @@ -211,7 +209,6 @@ func setupOptionsRoksPattern(t *testing.T, prefix string) *testhelper.TestOption "enable_transit_gateway": false, "use_ibm_cloud_private_api_endpoints": false, "verify_cluster_network_readiness": false, - "provider_visibility": "public", } return options @@ -261,7 +258,6 @@ func setupOptionsVsiPattern(t *testing.T, prefix string) *testhelper.TestOptions "region": options.Region, "add_atracker_route": add_atracker_route, "enable_transit_gateway": false, - "provider_visibility": "public", } return options @@ -308,7 +304,6 @@ func setupOptionsVpcPattern(t *testing.T, prefix string) *testhelper.TestOptions "region": options.Region, "add_atracker_route": add_atracker_route, "enable_transit_gateway": false, - "provider_visibility": "public", } return options @@ -458,7 +453,6 @@ func setupOptionsVsiExtention(t *testing.T, prefix string, region string, existi "boot_volume_encryption_key": keyID, "vpc_id": managementVpcID, "ssh_public_key": sshPublicKey, - "provider_visibility": "public", }, }) @@ -565,7 +559,8 @@ func TestRunVPCPatternSchematics(t *testing.T) { options.TerraformVars = []testschematic.TestSchematicTerraformVar{ {Name: "ibmcloud_api_key", Value: options.RequiredEnvironmentVars["TF_VAR_ibmcloud_api_key"], DataType: "string", Secure: true}, - {Name: "region", Value: options.Region, DataType: "string"}, + // Here Region is set explicitly to 'us-east' to plug the test gap as mentioned here : https://github.com/terraform-ibm-modules/terraform-ibm-landing-zone/issues/928 + {Name: "region", Value: "us-east", DataType: "string"}, {Name: "prefix", Value: options.Prefix, DataType: "string"}, {Name: "tags", Value: options.Tags, DataType: "list(string)"}, {Name: "add_atracker_route", Value: add_atracker_route, DataType: "bool"}, @@ -604,7 +599,6 @@ func TestRunVsiExtention(t *testing.T) { Vars: map[string]interface{}{ "prefix": prefix, "region": region, - "provider_visibility": "public", "tags": tags, "enable_transit_gateway": false, }, @@ -663,10 +657,9 @@ func TestRunUpgradeVsiExtention(t *testing.T) { existingTerraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{ TerraformDir: vpcTerraformDir, Vars: map[string]interface{}{ - "prefix": prefix, - "region": region, - "provider_visibility": "public", - "tags": tags, + "prefix": prefix, + "region": region, + "tags": tags, }, // Set Upgrade to true to ensure latest version of providers and modules are used by terratest. // This is the same as setting the -upgrade=true flag with terraform.