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 3ca7546 commit a6ed8cd
Show file tree
Hide file tree
Showing 5 changed files with 31 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 @@ -9,3 +9,4 @@ CRA_TARGETS:
TF_VAR_kms_key_crn: "crn:v1:bluemix:public:hs-crypto:us-south:a/abac0df06b644a9cabc6e44f55b3880e:e6dce284-e80f-46e1-a3c1-830f7adff7a9:key:1368d2eb-3ed0-4a8b-b09c-2155895f01ea"
TF_VAR_use_existing_resource_group: true
TF_VAR_resource_group_name: "geretain-test-redis"
TF_VAR_provider_visibility: "public"
17 changes: 17 additions & 0 deletions ibm_catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,23 @@
{
"key": "ibmcloud_api_key"
},
{
"key": "provider_visibility",
"options": [
{
"displayname": "private",
"value": "private"
},
{
"displayname": "public",
"value": "public"
},
{
"displayname": "public-and-private",
"value": "public-and-private"
}
]
},
{
"key": "use_existing_resource_group"
},
Expand Down
2 changes: 2 additions & 0 deletions solutions/standard/provider.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
provider "ibm" {
ibmcloud_api_key = var.ibmcloud_api_key
region = var.region
visibility = var.provider_visibility
}
provider "ibm" {
alias = "kms"
ibmcloud_api_key = var.ibmcloud_kms_api_key != null ? var.ibmcloud_kms_api_key : var.ibmcloud_api_key
region = local.existing_kms_instance_region
visibility = var.provider_visibility
}
10 changes: 10 additions & 0 deletions solutions/standard/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -227,3 +227,13 @@ variable "backup_crn" {
error_message = "backup_crn must be null OR starts with 'crn:' and contains ':backup:'"
}
}
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'."
}
}
1 change: 1 addition & 0 deletions tests/pr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ func TestRunStandardUpgradeSolution(t *testing.T) {
"access_tags": permanentResources["accessTags"],
"existing_kms_instance_crn": permanentResources["hpcs_south_crn"],
"kms_endpoint_type": "public",
"provider_visibility": "public",
"resource_group_name": options.Prefix,
}

Expand Down

0 comments on commit a6ed8cd

Please sign in to comment.