IBM Cloud: data.ibm_container_vpc_cluster .name returns the ID instead of the cluster name

With the IBM Cloud Terraform provider, data "ibmcontainervpccluster" looked up by ID returned the cluster ID (not the name) from the .name attribute, and using the deprecated clusternameid field returned null. The reporter needed the actual cluster name in config and resorted to parsing it out of the ingress hostname with a regex — fragile and undocumented. A community member found the undocumented resourcename field; the reporter confirmed it worked but asked for official support.

Do not parse the ingress hostname with a regex to get the cluster name. The data source exposes the actual name via the resourcename attribute (community-confirmed working), and the provider later added an officially supported clustername attribute on both the cluster and vpccluster data sources — a maintainer closed the issue as fixed with that addition. If your config uses data.ibmcontainervpccluster.cluster.name expecting a name, switch to clustername (or resourcename on older versions). Source: https://github.com/IBM-Cloud/terraform-provider-ibm/issues/4485