terraform-provider-ibm icon indicating copy to clipboard operation
terraform-provider-ibm copied to clipboard

Retrieve workers from a cluster based on a specified pool name

Open SIRISHA-SHARON opened this issue 2 years ago • 0 comments

This code fetches all workers from a cluster-

data "ibm_container_vpc_cluster" "cluster" {
  name = module.ocp_all_inclusive.cluster_name

  resource_group_id  = local.resource_group_id
}



data ibm_container_vpc_cluster_worker worker {
  count =  length(data.ibm_container_vpc_cluster.cluster.workers)

  worker_id         = element(data.ibm_container_vpc_cluster.cluster.workers, count.index)
  cluster_name_id   = module.ocp_all_inclusive.cluster_id
  resource_group_id = local.resource_group_id
}

Need a way to list only the workers belonging to a worker pool named that is not edge or transit.

How can I do that?

like

data ibm_container_vpc_cluster_worker workers_of_pool{


  worker_pool = <worker_pool_id_or_name>
  cluster_name_id   = module.ocp_all_inclusive.cluster_id
  resource_group_id = local.resource_group_id
 
}

SIRISHA-SHARON avatar Jul 04 '22 15:07 SIRISHA-SHARON