providers/aws: handle case where ELB is deleted manually [GH-304]
This commit is contained in:
parent
c5c72b1ce1
commit
b43ca0aa52
|
@ -63,6 +63,7 @@ BUG FIXES:
|
||||||
data.
|
data.
|
||||||
* providers/aws: ELB works properly with dynamically changing
|
* providers/aws: ELB works properly with dynamically changing
|
||||||
count of instances.
|
count of instances.
|
||||||
|
* providers/aws: Terraform can handle ELBs deleted manually. [GH-304]
|
||||||
|
|
||||||
## 0.2.2 (September 9, 2014)
|
## 0.2.2 (September 9, 2014)
|
||||||
|
|
||||||
|
|
|
@ -319,6 +319,12 @@ func resourceAwsElbRead(d *schema.ResourceData, meta interface{}) error {
|
||||||
|
|
||||||
describeResp, err := elbconn.DescribeLoadBalancers(describeElbOpts)
|
describeResp, err := elbconn.DescribeLoadBalancers(describeElbOpts)
|
||||||
if err != nil {
|
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)
|
return fmt.Errorf("Error retrieving ELB: %s", err)
|
||||||
}
|
}
|
||||||
if len(describeResp.LoadBalancers) != 1 {
|
if len(describeResp.LoadBalancers) != 1 {
|
||||||
|
|
Loading…
Reference in New Issue