Open vburckhardt opened 1 year ago
Looks like data.ibm_container_vpc_cluster.cluster.name
returns the cluster ID.
You have to use data.ibm_container_vpc_cluster.cluster.resource_name
to get the cluster name it seems.
Yes @Aashiq-J spotted the field resource_name in https://github.com/terraform-ibm-modules/terraform-ibm-observability-agents/pull/99 - the issue is that resource_name is not documented at https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/data-sources/container_vpc_cluster, so is there any guarantee that it is going to be maintained in future version. Let's use this tickets to get it officially supported / documented
Community Note
Terraform CLI and Terraform IBM Provider Version
IBM Cloud Terraform provider version 1.52
Affected Resource(s)
Terraform Configuration Files
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
Using the deprecated cluster_name_id field.
One may think to use the https://registry.terraform.io/providers/IBM-Cloud/ibm/1.52.0/docs/data-sources/resource_instance data source. But this is the same limitation whereby only the name can be passed as input.
I am using the following hack for now - but this is likely not stable.
Debug Output
Panic Output
Expected Behavior
Return the cluster name
Actual Behavior
Returning either the cluster Id or 'null'
Steps to Reproduce
See config above
Important Factoids
Could we get the option to pass an id as a parameter for most data source that take a name. The current provider interface looks hacky where an id is accepted in the field named "name" - and there is no id field.
References
0000