Skip to content

Commit 98cd367

Browse files
feat: exposed the ability to set the provider_visibility in the DA [Learn more](https://registry.terraform.io/providers/IBM-Cloud/IBM/latest/docs#visibility-1) (#334)
1 parent ff072ab commit 98cd367

File tree

5 files changed

+30
-0
lines changed

5 files changed

+30
-0
lines changed

cra-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ CRA_TARGETS:
99
TF_VAR_existing_kms_instance_crn: "crn:v1:bluemix:public:hs-crypto:us-south:a/abac0df06b644a9cabc6e44f55b3880e:e6dce284-e80f-46e1-a3c1-830f7adff7a9::"
1010
TF_VAR_kms_endpoint_url: "https://e6dce284-e80f-46e1-a3c1-830f7adff7a9.api.private.us-south.hs-crypto.appdomain.cloud"
1111
TF_VAR_cross_region_location: "us"
12+
TF_VAR_provider_visibility: "public"

ibm_catalog.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,23 @@
134134
"key": "kms_endpoint_url",
135135
"required": true
136136
},
137+
{
138+
"key": "provider_visibility",
139+
"options": [
140+
{
141+
"displayname": "private",
142+
"value": "private"
143+
},
144+
{
145+
"displayname": "public",
146+
"value": "public"
147+
},
148+
{
149+
"displayname": "public-and-private",
150+
"value": "public-and-private"
151+
}
152+
]
153+
},
137154
{
138155
"key": "existing_kms_root_key_crn"
139156
},

solutions/standard/provider.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
provider "ibm" {
22
ibmcloud_api_key = var.ibmcloud_api_key
33
region = var.region
4+
visibility = var.provider_visibility
45
}
56

67
provider "ibm" {
78
alias = "kms"
89
ibmcloud_api_key = var.ibmcloud_kms_api_key != null ? var.ibmcloud_kms_api_key : var.ibmcloud_api_key
910
region = local.kms_region
11+
visibility = var.provider_visibility
1012
}

solutions/standard/variables.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,16 @@ variable "ibmcloud_api_key" {
77
description = "The API key to use for IBM Cloud."
88
sensitive = true
99
}
10+
variable "provider_visibility" {
11+
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)."
12+
type = string
13+
default = "private"
1014

15+
validation {
16+
condition = contains(["public", "private", "public-and-private"], var.provider_visibility)
17+
error_message = "Invalid visibility option. Allowed values are 'public', 'private', or 'public-and-private'."
18+
}
19+
}
1120
variable "use_existing_resource_group" {
1221
type = bool
1322
description = "Whether to use an existing resource group."

tests/pr_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ func TestRunUpgradeDASolution(t *testing.T) {
212212
"existing_kms_instance_crn": permanentResources["hpcs_south_crn"],
213213
"kms_endpoint_url": permanentResources["hpcs_south_public_endpoint"],
214214
"kms_endpoint_type": "public",
215+
"provider_visibility": "public",
215216
"management_endpoint_type_for_bucket": "public",
216217
}
217218

0 commit comments

Comments
 (0)