Skip to content

Commit

Permalink
Merge pull request #8981 from terraform-providers/rfd-retry
Browse files Browse the repository at this point in the history
Final retry for deleting elasticache security group
  • Loading branch information
bflad authored Jun 13, 2019
2 parents 1357231 + 5931c71 commit 6f3904e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion aws/resource_aws_elasticache_security_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func resourceAwsElasticacheSecurityGroupDelete(d *schema.ResourceData, meta inte

log.Printf("[DEBUG] Cache security group delete: %s", d.Id())

return resource.Retry(5*time.Minute, func() *resource.RetryError {
err := resource.Retry(5*time.Minute, func() *resource.RetryError {
_, err := conn.DeleteCacheSecurityGroup(&elasticache.DeleteCacheSecurityGroupInput{
CacheSecurityGroupName: aws.String(d.Id()),
})
Expand All @@ -150,4 +150,12 @@ func resourceAwsElasticacheSecurityGroupDelete(d *schema.ResourceData, meta inte
}
return nil
})

if isResourceTimeoutError(err) {
_, err = conn.DeleteCacheSecurityGroup(&elasticache.DeleteCacheSecurityGroupInput{
CacheSecurityGroupName: aws.String(d.Id()),
})
}

return err
}

0 comments on commit 6f3904e

Please sign in to comment.