From bea18036e51df0fa9c8ec66b3fa91d5f6a09ff64 Mon Sep 17 00:00:00 2001 From: Rei Odaira Date: Wed, 25 Mar 2020 11:58:22 -0500 Subject: [PATCH] Allow deleting a non-existing subnet --- ibm/resource_ibm_is_subnet.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ibm/resource_ibm_is_subnet.go b/ibm/resource_ibm_is_subnet.go index d8f17e6b82..a0b78fdab9 100644 --- a/ibm/resource_ibm_is_subnet.go +++ b/ibm/resource_ibm_is_subnet.go @@ -344,6 +344,13 @@ func resourceIBMISSubnetDelete(d *schema.ResourceData, meta interface{}) error { subnet, err := subnetC.Get(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 }