Skip to content

Commit

Permalink
feat: exposed the ability to set the provider_visibility in the DA …
Browse files Browse the repository at this point in the history
  • Loading branch information
Aditya-ranjan-16 authored Nov 26, 2024
1 parent 868e9a6 commit 3375c65
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions cra-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ CRA_TARGETS:
TF_VAR_signing_key: "dummy value"
TF_VAR_secrets_manager_guid: "dummy guid"
TF_VAR_secrets_manager_region: "us-south"
TF_VAR_provider_visibility: "public"
19 changes: 19 additions & 0 deletions ibm_catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,25 @@
}
]
},
"configuration":[
{
"key": "provider_visibility",
"options": [
{
"displayname": "private",
"value": "private"
},
{
"displayname": "public",
"value": "public"
},
{
"displayname": "public-and-private",
"value": "public-and-private"
}
]
}
],
"release_notes_url": "RELEASE NOTES URL",
"outputs": [],
"install_type": "fullstack"
Expand Down
3 changes: 3 additions & 0 deletions solutions/banking/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,20 @@ provider "ibm" {
alias = "ibm_resources"
ibmcloud_api_key = var.ibmcloud_api_key
region = var.toolchain_region
visibility = var.provider_visibility
}

provider "ibm" {
alias = "sm_resources"
ibmcloud_api_key = var.ibmcloud_api_key
region = var.secrets_manager_region
visibility = var.provider_visibility
}

provider "ibm" {
ibmcloud_api_key = var.watsonx_admin_api_key != null ? var.watsonx_admin_api_key : var.ibmcloud_api_key
region = var.toolchain_region
visibility = var.provider_visibility
}

provider "restapi" {
Expand Down
9 changes: 9 additions & 0 deletions solutions/banking/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@ 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 "watsonx_admin_api_key" {
default = null
description = "Used to call Watson APIs to configure the user and the project."
Expand Down
1 change: 1 addition & 0 deletions tests/pr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ func setupOptions(t *testing.T, prefix string, existingTerraformOptions *terrafo
"signing_key": terraform.Output(t, existingTerraformOptions, "signing_key"),
"trigger_ci_pipeline_run": false,
"secrets_manager_endpoint_type": "public",
"provider_visibility": "public",
"create_secrets": false,
},
})
Expand Down

0 comments on commit 3375c65

Please sign in to comment.