resource "ibm_container_vpc_cluster" "single_zone_cas_cluster" {
  name              = "cas"
  vpc_id            = var.vpc_id
  flavor            = var.flavour
  kube_version      = var.kube_version
  worker_count      = var.worker_count
  resource_group_id = var.resource_group

  zones {
    subnet_id = ""
    name      = "us-south-1"
  }
}

resource "ibm_container_vpc_worker_pool" "single_zone_cas_pool" {
  cluster          = ibm_container_vpc_cluster.single_zone_cas_cluster.name
  worker_pool_name = "${ibm_container_vpc_cluster.single_zone_cas_cluster.name}_vpc_pool"
  flavor           = "c2.2x4"
  vpc_id           = ibm_container_vpc_cluster.single_zone_cas_cluster.vpc_id
  worker_count     = "1"

  zones {
    subnet_id = ibm_container_vpc_cluster.single_zone_cas_cluster.subnet_id
    name      = "us-south-1"
  }
}
