Data block "ibm_database_connection" does not take "public-and-private" as endpoint type
Closed this issue · 2 comments
This data block
terraform-ibm-icd-mysql/main.tf
Line 220 in 8722c02
only take values public
and private
as endpoint type, which is creating an issue when passing public-and-private
by direclty passing this variable value as public-and-private
as it is an allowed value in variable constraints.
terraform-ibm-icd-mysql/variables.tf
Line 79 in 8722c02
Should we have some conditional check on the data block endpoint_type
based on the service_endpoints
as it supportspublic
, private
and public-and-private
or should we create another variable for endpoint_type
?
@Ak-sky I suggest use logic like this instead:
data "ibm_database_connection" "database_connection" {
endpoint_type = var.service_endpoints == "public-and-private" ? "public" : "private"
deployment_id = ibm_database.mysql_db.id
user_id = ibm_database.mysql_db.adminuser
user_type = "database"
}
Release available in https://github.com/terraform-ibm-modules/terraform-ibm-icd-mysql/releases/tag/v1.2.4, closing this.