From 214996eaa93889d85ec7ebbe93013bada0bc7618 Mon Sep 17 00:00:00 2001 From: Rei Odaira Date: Wed, 25 Mar 2020 11:59:18 -0500 Subject: [PATCH] Allow deleting a non-existing VPC --- ibm/resource_ibm_is_vpc.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ibm/resource_ibm_is_vpc.go b/ibm/resource_ibm_is_vpc.go index 725d1b80f5..cd5780827e 100644 --- a/ibm/resource_ibm_is_vpc.go +++ b/ibm/resource_ibm_is_vpc.go @@ -330,6 +330,13 @@ func resourceIBMISVPCDelete(d *schema.ResourceData, meta interface{}) error { vpcC := network.NewVPCClient(sess) err = vpcC.Delete(d.Id()) if err != nil { + iserror, ok := err.(iserrors.RiaasError) + if ok { + if len(iserror.Payload.Errors) == 1 && + iserror.Payload.Errors[0].Code == "not_found" { + return nil + } + } return err }