providers/aws: subnet retry destroy [GH-357]

This commit is contained in:
Mitchell Hashimoto 2014-10-07 21:52:08 -07:00
parent ef62fa80db
commit ca99811357
3 changed files with 7 additions and 4 deletions

View File

@ -49,6 +49,8 @@ BUG FIXES:
* core: Plugin loading from CWD works properly.
* 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: Retry deleting subnet for some time while AWS eventually
destroys dependencies. [GH-357]
## 0.2.2 (September 9, 2014)

View File

@ -88,7 +88,11 @@ func resource_aws_subnet_destroy(
ec2conn := p.ec2conn
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)
if ok && ec2err.Code == "InvalidSubnetID.NotFound" {
return nil

View File

@ -92,7 +92,4 @@ func testAccPreCheck(t *testing.T) {
log.Println("[INFO] Test: Using us-west-2 as test region")
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")
}
}