Skip to content

Commit 51797eb

Browse files
feat: exposes the ability to set the provider_visibility in the DA (#65)
1 parent 8c6d089 commit 51797eb

File tree

5 files changed

+31
-0
lines changed

5 files changed

+31
-0
lines changed

cra-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ CRA_TARGETS:
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: # 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_mq_capacity_crn: "crn:v1:bluemix:public:mqcloud:us-east:a/abac0df06b644a9cabc6e44f55b3880e:9d9a3c00-2097-4da4-a5e4-78e06514b342::"
9+
TF_VAR_provider_visibility: "public"
910
TF_VAR_resource_group_name: "test"
1011
TF_VAR_deployment_name: "deployment"
1112
TF_VAR_queue_manager_name: "qm"

ibm_catalog.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,23 @@
5353
"key": "ibmcloud_api_key",
5454
"required": true
5555
},
56+
{
57+
"key": "provider_visibility",
58+
"options": [
59+
{
60+
"displayname": "private",
61+
"value": "private"
62+
},
63+
{
64+
"displayname": "public",
65+
"value": "public"
66+
},
67+
{
68+
"displayname": "public-and-private",
69+
"value": "public-and-private"
70+
}
71+
]
72+
},
5673
{
5774
"key": "use_existing_resource_group"
5875
},

solutions/standard/provider.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
provider "ibm" {
66
ibmcloud_api_key = var.ibmcloud_api_key
77
region = var.region
8+
visibility = var.provider_visibility
89
}

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 IBM Cloud API key to deploy resources."
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 "region" {
1221
type = string
1322
description = "Region to provision new resources created by this solution."

tests/pr_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ func TestRunUpgradeExample(t *testing.T) {
7575
"queue_manager_size": "xsmall",
7676
"resource_group_name": options.Prefix,
7777
"application_name": "app",
78+
"provider_visibility": "public",
7879
"user_email": "mq-user@exmaple.com",
7980
"user_name": "mq-user",
8081
}
@@ -107,6 +108,7 @@ func TestRunInstanceOnlyExample(t *testing.T) {
107108
"queue_manager_name": "inst",
108109
"queue_manager_display_name": "instance-display",
109110
"queue_manager_size": "xsmall",
111+
"provider_visibility": "public",
110112
"resource_group_name": options.Prefix,
111113
}
112114

@@ -145,6 +147,7 @@ func TestRunStandardSolutionSchematics(t *testing.T) {
145147
{Name: "resource_group_name", Value: options.Prefix, DataType: "string"},
146148
{Name: "region", Value: "us-east", DataType: "string"},
147149
{Name: "deployment_name", Value: "da-mq-instance", DataType: "string"},
150+
{Name: "provider_visibility", Value: "public", DataType: "string"},
148151
{Name: "queue_manager_name", Value: "da_qm", DataType: "string"},
149152
{Name: "queue_manager_display_name", Value: "da-qm-display", DataType: "string"},
150153
{Name: "queue_manager_size", Value: "xsmall", DataType: "string"},

0 commit comments

Comments
 (0)