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 bb897b5 commit 53580ae
Show file tree
Hide file tree
Showing 5 changed files with 30 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 @@ -6,3 +6,4 @@ CRA_TARGETS:
PROFILE_ID: "48279384-3d29-4089-8259-8ed354774b4a" # SCC profile ID (currently set to 'CIS IBM Cloud Foundations Benchmark v1.1.0' '1.1.0' profile).
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.
TF_VAR_resource_group_name: "test"
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 @@ -65,6 +65,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
1 change: 1 addition & 0 deletions solutions/standard/provider.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
provider "ibm" {
ibmcloud_api_key = var.ibmcloud_api_key
region = var.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 @@ -8,6 +8,16 @@ variable "ibmcloud_api_key" {
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 "use_existing_resource_group" {
type = bool
description = "Whether to use an existing resource group."
Expand Down
1 change: 1 addition & 0 deletions tests/pr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ func TestRunUpgradeDASolution(t *testing.T) {
terraformVars := map[string]interface{}{
"resource_group_name": options.Prefix,
"kms_endpoint_type": "public",
"provider_visibility": "public",
"existing_kms_instance_crn": permanentResources["hpcs_south_crn"],
"keys": []map[string]interface{}{{"key_ring_name": "my-key-ring", "keys": []map[string]interface{}{{"key_name": "some-key-name-1"}, {"key_name": "some-key-name-2"}}}},
"resource_tags": []string{"kms-da-upg"},
Expand Down

0 comments on commit 53580ae

Please sign in to comment.