From ce6e445b8e89cb8df966d7041342109d3e6159c4 Mon Sep 17 00:00:00 2001 From: Justin SB Date: Wed, 30 Jan 2019 11:47:56 -0500 Subject: [PATCH] VPC cleanup: recognize the error code for concurrent VPC deletion Hit this when I was cleaning up my VPCs manually. --- pkg/resources/aws/vpc.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/resources/aws/vpc.go b/pkg/resources/aws/vpc.go index 093ba5e441d6c..ff3a24da26338 100644 --- a/pkg/resources/aws/vpc.go +++ b/pkg/resources/aws/vpc.go @@ -39,6 +39,11 @@ func DeleteVPC(cloud fi.Cloud, r *resources.Resource) error { } _, err := c.EC2().DeleteVpc(request) if err != nil { + if awsup.AWSErrorCode(err) == "InvalidVpcID.NotFound" { + // Concurrently deleted + return nil + } + if IsDependencyViolation(err) { return err }