Added error checking and removed debug statement
This commit is contained in:
parent
7293ab99d3
commit
923f7dca37
|
@ -300,9 +300,6 @@ func (lt *opsworksLayerType) Read(d *schema.ResourceData, client *opsworks.OpsWo
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
loadBalancers, err := client.DescribeElasticLoadBalancers(ebsRequest)
|
loadBalancers, err := client.DescribeElasticLoadBalancers(ebsRequest)
|
||||||
|
|
||||||
fmt.Println(loadBalancers)
|
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -359,10 +356,13 @@ func (lt *opsworksLayerType) Create(d *schema.ResourceData, client *opsworks.Ops
|
||||||
loadBalancer := aws.String(d.Get("elastic_load_balancer").(string))
|
loadBalancer := aws.String(d.Get("elastic_load_balancer").(string))
|
||||||
if loadBalancer != nil && *loadBalancer != "" {
|
if loadBalancer != nil && *loadBalancer != "" {
|
||||||
log.Printf("[DEBUG] Attaching load balancer: %s", *loadBalancer)
|
log.Printf("[DEBUG] Attaching load balancer: %s", *loadBalancer)
|
||||||
client.AttachElasticLoadBalancer(&opsworks.AttachElasticLoadBalancerInput{
|
_, err := client.AttachElasticLoadBalancer(&opsworks.AttachElasticLoadBalancerInput{
|
||||||
ElasticLoadBalancerName: loadBalancer,
|
ElasticLoadBalancerName: loadBalancer,
|
||||||
LayerId: &layerId,
|
LayerId: &layerId,
|
||||||
})
|
})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return lt.Read(d, client)
|
return lt.Read(d, client)
|
||||||
|
|
Loading…
Reference in New Issue