From 1a28677c7a551e67c7394040668826de1d58a3dd Mon Sep 17 00:00:00 2001 From: Radek Simko Date: Sat, 9 May 2015 21:52:56 +0100 Subject: [PATCH] Increase subnet & security group deletion timeout (2 -> 5 secs) - this should prevent DependencyViolation errors while waiting for larger larger ASGs to shut down --- builtin/providers/aws/resource_aws_security_group.go | 2 +- builtin/providers/aws/resource_aws_subnet.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/providers/aws/resource_aws_security_group.go b/builtin/providers/aws/resource_aws_security_group.go index f87d7b2f5596..703f8b560bc5 100644 --- a/builtin/providers/aws/resource_aws_security_group.go +++ b/builtin/providers/aws/resource_aws_security_group.go @@ -295,7 +295,7 @@ func resourceAwsSecurityGroupDelete(d *schema.ResourceData, meta interface{}) er log.Printf("[DEBUG] Security Group destroy: %v", d.Id()) - return resource.Retry(2*time.Minute, func() error { + return resource.Retry(5*time.Minute, func() error { _, err := conn.DeleteSecurityGroup(&ec2.DeleteSecurityGroupInput{ GroupID: aws.String(d.Id()), }) diff --git a/builtin/providers/aws/resource_aws_subnet.go b/builtin/providers/aws/resource_aws_subnet.go index 1fa51bacb221..cc0ddec19566 100644 --- a/builtin/providers/aws/resource_aws_subnet.go +++ b/builtin/providers/aws/resource_aws_subnet.go @@ -166,7 +166,7 @@ func resourceAwsSubnetDelete(d *schema.ResourceData, meta interface{}) error { wait := resource.StateChangeConf{ Pending: []string{"pending"}, Target: "destroyed", - Timeout: 2 * time.Minute, + Timeout: 5 * time.Minute, MinTimeout: 1 * time.Second, Refresh: func() (interface{}, string, error) { _, err := conn.DeleteSubnet(req)