VPC cleanup: recognize the error code for concurrent VPC deletion

Hit this when I was cleaning up my VPCs manually.
This commit is contained in:
Justin SB 2019-01-30 11:47:56 -05:00
parent 4ca73f8d85
commit 49b40c9150
No known key found for this signature in database
GPG Key ID: 8DEC5C8217494E37
1 changed files with 5 additions and 0 deletions

View File

@ -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
}