From ac0027b18d479cb463d53b76204feb9b781138a8 Mon Sep 17 00:00:00 2001 From: chenhanzhang Date: Wed, 25 Dec 2024 13:52:22 +0800 Subject: [PATCH] resource/alicloud_mongodb_instance: add retry code while deleting instance. --- alicloud/resource_alicloud_mongodb_instance.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alicloud/resource_alicloud_mongodb_instance.go b/alicloud/resource_alicloud_mongodb_instance.go index 6df8480e4113..9feae0b1e3b8 100644 --- a/alicloud/resource_alicloud_mongodb_instance.go +++ b/alicloud/resource_alicloud_mongodb_instance.go @@ -1276,7 +1276,7 @@ func resourceAliCloudMongoDBInstanceDelete(d *schema.ResourceData, meta interfac err = resource.Retry(client.GetRetryTimeout(d.Timeout(schema.TimeoutDelete)), func() *resource.RetryError { response, err = conn.DoRequest(StringPointer(action), nil, StringPointer("POST"), StringPointer("2015-12-01"), StringPointer("AK"), nil, request, &runtime) if err != nil { - if NeedRetry(err) { + if NeedRetry(err) || IsExpectedErrors(err, []string{"OperationDenied.DBInstanceStatus"}) { wait() return resource.RetryableError(err) }