Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:exposed visibility value for the provider in the DA #245

Merged
merged 6 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions ibm_catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,26 @@
"description": "This architecture supports creating and configuring an IBM Cloudant instance and database in an existing IBM Dedicated environment."
}
]
},
"configuration":[
{
"key": "provider_visibility",
"options": [
{
"displayname": "private",
"value": "private"
},
{
"displayname": "public",
"value": "public"
},
{
"displayname": "public-and-private",
"value": "public-and-private"
}
]
}
]
}
]
}
Expand Down
1 change: 1 addition & 0 deletions solutions/dedicated/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ provider "ibm" {
ibmcloud_api_key = var.ibmcloud_api_key
region = var.region
ibmcloud_timeout = 60
visibility = var.provider_visibility
}
10 changes: 10 additions & 0 deletions solutions/dedicated/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,13 @@ variable "database_config" {
description = "The databases to create in the IBM Cloudant instance with options to create partitions and shards."
default = []
}
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 @@ -78,6 +78,7 @@ func TestRunDedicatedSolution(t *testing.T) {
// crn of the dedicated host
"environment_crn": permanentResources["dedicatedHostCrn"],
"existing_resource_group": true,
"provider_visibility": "public",
"resource_group_name": options.ResourceGroup,
"instance_name": options.Prefix,
"database_config": []map[string]interface{}{
Expand Down