From dd0ec5c9b0007e0b2ed0bd8239ca939370206b2f Mon Sep 17 00:00:00 2001 From: Zhenguo Niu Date: Tue, 17 Mar 2020 09:31:56 +0000 Subject: [PATCH] Fix ecs instance delete issue --- huaweicloud/resource_huaweicloud_ecs_instance_v1.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/huaweicloud/resource_huaweicloud_ecs_instance_v1.go b/huaweicloud/resource_huaweicloud_ecs_instance_v1.go index dec5fa8605..6d809b0419 100644 --- a/huaweicloud/resource_huaweicloud_ecs_instance_v1.go +++ b/huaweicloud/resource_huaweicloud_ecs_instance_v1.go @@ -336,6 +336,10 @@ func resourceEcsInstanceV1Read(d *schema.ResourceData, meta interface{}) error { if err != nil { return CheckDeleted(d, err, "server") } + if server.Status == "DELETED" { + d.SetId("") + return nil + } log.Printf("[DEBUG] Retrieved Server %s: %+v", d.Id(), server)