providers/aws: elb destroy
This commit is contained in:
parent
8f5232313c
commit
553e0a5d9a
|
@ -98,16 +98,37 @@ func resource_aws_elb_update(
|
||||||
// p := meta.(*ResourceProvider)
|
// p := meta.(*ResourceProvider)
|
||||||
// elbconn := p.elbconn
|
// elbconn := p.elbconn
|
||||||
|
|
||||||
// Merge the diff into the state so that we have all the attributes
|
rs := s.MergeDiff(d)
|
||||||
// properly.
|
log.Printf("ResourceDiff: %s", d)
|
||||||
// rs := s.MergeDiff(d)
|
log.Printf("ResourceState: %s", s)
|
||||||
|
log.Printf("Merged: %s", rs)
|
||||||
|
|
||||||
return nil, nil
|
// If we have any instances, we need to register them
|
||||||
|
v := flatmap.Expand(rs.Attributes, "instances").([]interface{})
|
||||||
|
instances := expandStringList(v)
|
||||||
|
|
||||||
|
log.Println(instances)
|
||||||
|
|
||||||
|
return nil, fmt.Errorf("Did not update")
|
||||||
}
|
}
|
||||||
|
|
||||||
func resource_aws_elb_destroy(
|
func resource_aws_elb_destroy(
|
||||||
s *terraform.ResourceState,
|
s *terraform.ResourceState,
|
||||||
meta interface{}) error {
|
meta interface{}) error {
|
||||||
|
p := meta.(*ResourceProvider)
|
||||||
|
elbconn := p.elbconn
|
||||||
|
|
||||||
|
log.Printf("[INFO] Deleting ELB: %s", s.ID)
|
||||||
|
|
||||||
|
// Destroy the load balancer
|
||||||
|
deleteElbOpts := elb.DeleteLoadBalancer{
|
||||||
|
LoadBalancerName: s.ID,
|
||||||
|
}
|
||||||
|
_, err := elbconn.DeleteLoadBalancer(&deleteElbOpts)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("Error deleting ELB: %s", err)
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue