Skip to content

Commit 9b76e2f

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) (#233)
Co-authored-by: shemau <shemau@gmail.com>
1 parent b60bfd8 commit 9b76e2f

File tree

5 files changed

+32
-0
lines changed

5 files changed

+32
-0
lines changed

cra-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ CRA_TARGETS:
77
CRA_ENVIRONMENT_VARIABLES: # An optional map of environment variables for CRA, where the key is the variable name and value is the value. Useful for providing TF_VARs.
88
TF_VAR_existing_kms_instance_crn: "crn:v1:bluemix:public:hs-crypto:us-south:a/abac0df06b644a9cabc6e44f55b3880e:e6dce284-e80f-46e1-a3c1-830f7adff7a9::"
99
TF_VAR_resource_group_name: "test"
10+
TF_VAR_provider_visibility: "public"

ibm_catalog.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,23 @@
6262
{
6363
"key": "ibmcloud_api_key"
6464
},
65+
{
66+
"key": "provider_visibility",
67+
"options": [
68+
{
69+
"displayname": "private",
70+
"value": "private"
71+
},
72+
{
73+
"displayname": "public",
74+
"value": "public"
75+
},
76+
{
77+
"displayname": "public-and-private",
78+
"value": "public-and-private"
79+
}
80+
]
81+
},
6582
{
6683
"key": "use_existing_resource_group"
6784
},

solutions/standard/provider.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
provider "ibm" {
22
ibmcloud_api_key = var.ibmcloud_api_key
33
region = var.region
4+
visibility = var.provider_visibility
45
}
56
provider "ibm" {
67
alias = "kms"
78
ibmcloud_api_key = var.ibmcloud_kms_api_key != null ? var.ibmcloud_kms_api_key : var.ibmcloud_api_key
89
region = local.kms_region
10+
visibility = var.provider_visibility
911
}

solutions/standard/variables.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ variable "ibmcloud_api_key" {
88
sensitive = true
99
}
1010

11+
variable "provider_visibility" {
12+
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)."
13+
type = string
14+
default = "private"
15+
16+
validation {
17+
condition = contains(["public", "private", "public-and-private"], var.provider_visibility)
18+
error_message = "Invalid visibility option. Allowed values are 'public', 'private', or 'public-and-private'."
19+
}
20+
}
1121
variable "use_existing_resource_group" {
1222
type = bool
1323
description = "Whether to use an existing resource group."

tests/pr_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ func TestRunExistingResourcesInstances(t *testing.T) {
201201
"iam_engine_enabled": true,
202202
"private_engine_enabled": true,
203203
"existing_secrets_endpoint_type": "public",
204+
"provider_visibility": "public",
204205
},
205206
})
206207

@@ -230,6 +231,7 @@ func TestRunExistingResourcesInstances(t *testing.T) {
230231
"iam_engine_enabled": true,
231232
"private_engine_enabled": true,
232233
"existing_secrets_endpoint_type": "public",
234+
"provider_visibility": "public",
233235
"allowed_network": "public-and-private",
234236
},
235237
})

0 commit comments

Comments
 (0)