providers/aws: subnet retry destroy [GH-357]
This commit is contained in:
parent
ef62fa80db
commit
ca99811357
|
@ -49,6 +49,8 @@ BUG FIXES:
|
||||||
* core: Plugin loading from CWD works properly.
|
* core: Plugin loading from CWD works properly.
|
||||||
* providers/aws: autoscaling_group can be launched into a vpc [GH-259]
|
* providers/aws: autoscaling_group can be launched into a vpc [GH-259]
|
||||||
* providers/aws: not an error when RDS instance is deleted manually. [GH-307]
|
* providers/aws: not an error when RDS instance is deleted manually. [GH-307]
|
||||||
|
* providers/aws: Retry deleting subnet for some time while AWS eventually
|
||||||
|
destroys dependencies. [GH-357]
|
||||||
|
|
||||||
## 0.2.2 (September 9, 2014)
|
## 0.2.2 (September 9, 2014)
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,11 @@ func resource_aws_subnet_destroy(
|
||||||
ec2conn := p.ec2conn
|
ec2conn := p.ec2conn
|
||||||
|
|
||||||
log.Printf("[INFO] Deleting Subnet: %s", s.ID)
|
log.Printf("[INFO] Deleting Subnet: %s", s.ID)
|
||||||
if _, err := ec2conn.DeleteSubnet(s.ID); err != nil {
|
f := func() error {
|
||||||
|
_, err := ec2conn.DeleteSubnet(s.ID)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := resource.Retry(10 * time.Second, f); err != nil {
|
||||||
ec2err, ok := err.(*ec2.Error)
|
ec2err, ok := err.(*ec2.Error)
|
||||||
if ok && ec2err.Code == "InvalidSubnetID.NotFound" {
|
if ok && ec2err.Code == "InvalidSubnetID.NotFound" {
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -92,7 +92,4 @@ func testAccPreCheck(t *testing.T) {
|
||||||
log.Println("[INFO] Test: Using us-west-2 as test region")
|
log.Println("[INFO] Test: Using us-west-2 as test region")
|
||||||
os.Setenv("AWS_REGION", "us-west-2")
|
os.Setenv("AWS_REGION", "us-west-2")
|
||||||
}
|
}
|
||||||
if v := os.Getenv("AWS_SSL_CERTIFICATE_ID"); v == "" {
|
|
||||||
t.Fatal("AWS_SSL_CERTIFICATE_ID must be set for acceptance tests")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue