From 8313a98cb9b654723526b18764f7d40e84a30489 Mon Sep 17 00:00:00 2001 From: Aayush-Abhyarthi Date: Wed, 3 Dec 2025 14:18:39 +0530 Subject: [PATCH 1/3] fix: set provider visibility to private --- examples/backup-restore/provider.tf | 1 + examples/backup-restore/variables.tf | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/examples/backup-restore/provider.tf b/examples/backup-restore/provider.tf index df45ef50..f69fb6da 100644 --- a/examples/backup-restore/provider.tf +++ b/examples/backup-restore/provider.tf @@ -1,4 +1,5 @@ provider "ibm" { ibmcloud_api_key = var.ibmcloud_api_key region = var.region + visibility = var.provider_visibility } diff --git a/examples/backup-restore/variables.tf b/examples/backup-restore/variables.tf index bffc8173..37eca3a1 100644 --- a/examples/backup-restore/variables.tf +++ b/examples/backup-restore/variables.tf @@ -4,6 +4,17 @@ 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 "region" { type = string description = "Region to provision all resources created by this example." From 37000333ec1c3c37215a597bcac5c7bb7f1d7dbb Mon Sep 17 00:00:00 2001 From: Aayush-Abhyarthi Date: Wed, 3 Dec 2025 18:07:10 +0530 Subject: [PATCH 2/3] remove validation --- examples/backup-restore/variables.tf | 5 ----- 1 file changed, 5 deletions(-) diff --git a/examples/backup-restore/variables.tf b/examples/backup-restore/variables.tf index 37eca3a1..bff5ccdb 100644 --- a/examples/backup-restore/variables.tf +++ b/examples/backup-restore/variables.tf @@ -8,11 +8,6 @@ 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" { From 5745171adcc8bd1d19ad6c2595d56e9c6d207218 Mon Sep 17 00:00:00 2001 From: Aayush-Abhyarthi Date: Mon, 8 Dec 2025 14:55:52 +0530 Subject: [PATCH 3/3] changes --- examples/backup-restore/variables.tf | 2 +- tests/other_test.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/backup-restore/variables.tf b/examples/backup-restore/variables.tf index bff5ccdb..4af3e868 100644 --- a/examples/backup-restore/variables.tf +++ b/examples/backup-restore/variables.tf @@ -7,7 +7,7 @@ variable "ibmcloud_api_key" { 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" + default = "public" } variable "region" { diff --git a/tests/other_test.go b/tests/other_test.go index 5d5a3586..89a255b5 100644 --- a/tests/other_test.go +++ b/tests/other_test.go @@ -96,6 +96,7 @@ func TestRunRestoredDBExample(t *testing.T) { ResourceGroup: resourceGroup, TerraformVars: map[string]interface{}{ "existing_database_crn": permanentResources["elasticsearchCrn"], + "provider_visibility": "private", }, CloudInfoService: sharedInfoSvc, })