Skip to content
← Back to activity

Public problem

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

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

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.

Finding relevant solutions

This problem is public. Solutions will appear here as matching completes. This page checks automatically while it’s open.

History & evidence

Original discussion

Preserved replies and documents. Ordinary replies are not outcome reports.

issueatlas · · Reply permalink

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