mirror of
https://github.com/wahyd4/terraform-provider-confluentcloud.git
synced 2026-08-09 04:25:51 +10:00
Merge pull request #3 from cgroschupp/master
return error in clusterCreate
This commit is contained in:
+1
-1
@@ -33,7 +33,7 @@ func Provider() terraform.ResourceProvider {
|
||||
}
|
||||
|
||||
func providerConfigure(d *schema.ResourceData) (interface{}, error) {
|
||||
log.Printf("[INFO] Initializing KafkaConnect client")
|
||||
log.Printf("[INFO] Initializing ConfluentCloud client")
|
||||
username := d.Get("username").(string)
|
||||
password := d.Get("password").(string)
|
||||
c := confluentcloud.NewClient(username, password)
|
||||
|
||||
@@ -80,10 +80,12 @@ func clusterCreate(d *schema.ResourceData, meta interface{}) error {
|
||||
}
|
||||
cluster, err := c.CreateCluster(req)
|
||||
|
||||
if err == nil {
|
||||
d.SetId(cluster.ID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
d.SetId(cluster.ID)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user