providers/aws: handle case where ELB is deleted manually [GH-304]

pull/389/head
Mitchell Hashimoto 12 years ago
parent c5c72b1ce1
commit b43ca0aa52

@ -63,6 +63,7 @@ BUG FIXES:
data.
* providers/aws: ELB works properly with dynamically changing
count of instances.
* providers/aws: Terraform can handle ELBs deleted manually. [GH-304]
## 0.2.2 (September 9, 2014)

@ -319,6 +319,12 @@ func resourceAwsElbRead(d *schema.ResourceData, meta interface{}) error {
describeResp, err := elbconn.DescribeLoadBalancers(describeElbOpts)
if err != nil {
if ec2err, ok := err.(*elb.Error); ok && ec2err.Code == "LoadBalancerNotFound" {
// The ELB is gone now, so just remove it from the state
d.SetId("")
return nil
}
return fmt.Errorf("Error retrieving ELB: %s", err)
}
if len(describeResp.LoadBalancers) != 1 {

Loading…
Cancel
Save