Skip to content

Commit

Permalink
fix: provisioning dedicated clusters require CKU as a mandatory >0
Browse files Browse the repository at this point in the history
  • Loading branch information
Som authored and Mongey committed Dec 17, 2020
1 parent 4a0730d commit f9c9fac
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ccloud/resource_kafka_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ func kafkaClusterResource() *schema.Resource {
},
},
},
"cku": {
Type: schema.TypeInt,
Optional: true,
ForceNew: true,
Description: "cku",
},
},
}
}
Expand All @@ -107,6 +113,7 @@ func clusterCreate(d *schema.ResourceData, meta interface{}) error {
storage := d.Get("storage").(int)
networkIngress := d.Get("network_ingress").(int)
networkEgress := d.Get("network_egress").(int)
cku := d.Get("cku").(int)

log.Printf("[DEBUG] Creating kafka_cluster")

Expand All @@ -130,6 +137,7 @@ func clusterCreate(d *schema.ResourceData, meta interface{}) error {
Deployment: dep,
NetworkIngress: networkIngress,
NetworkEgress: networkEgress,
Cku: cku,
}

cluster, err := c.CreateCluster(req)
Expand Down Expand Up @@ -187,5 +195,8 @@ func clusterRead(d *schema.ResourceData, meta interface{}) error {
if err == nil {
err = d.Set("network_egress", cluster.NetworkEgress)
}
if err == nil {
err = d.Set("cku", cluster.Cku)
}
return err
}

0 comments on commit f9c9fac

Please sign in to comment.