diff --git a/builtin/providers/librato/resource_librato_space.go b/builtin/providers/librato/resource_librato_space.go index e0c1242a4..917e3ec3d 100644 --- a/builtin/providers/librato/resource_librato_space.go +++ b/builtin/providers/librato/resource_librato_space.go @@ -115,6 +115,11 @@ func resourceLibratoSpaceDelete(d *schema.ResourceData, meta interface{}) error log.Printf("[INFO] Deleting Space: %d", id) _, err = client.Spaces.Delete(uint(id)) if err != nil { + if errResp, ok := err.(*librato.ErrorResponse); ok && errResp.Response.StatusCode == 404 { + log.Printf("Space %s not found", d.Id()) + d.SetId("") + return nil + } return fmt.Errorf("Error deleting space: %s", err) }