@@ -12,6 +12,7 @@ import (
1212 "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
1313 cfs "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cfs/v20190719"
1414
15+ sdkErrors "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors"
1516 "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper"
1617 "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/ratelimit"
1718)
@@ -76,6 +77,11 @@ func resourceTencentCloudCfsAccessRuleCreate(d *schema.ResourceData, meta interf
7677 if err != nil {
7778 log .Printf ("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n " ,
7879 logId , request .GetAction (), request .ToJsonString (), err .Error ())
80+ if e , ok := err .(* sdkErrors.TencentCloudSDKError ); ok {
81+ if e .GetCode () == FAILED_OPERATION_PGROUP_IS_UPDATING_ERROR {
82+ return resource .RetryableError (err )
83+ }
84+ }
7985 return tccommon .RetryError (err )
8086 }
8187 log .Printf ("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n " ,
@@ -162,6 +168,11 @@ func resourceTencentCloudCfsAccessRuleUpdate(d *schema.ResourceData, meta interf
162168 if err != nil {
163169 log .Printf ("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n " ,
164170 logId , request .GetAction (), request .ToJsonString (), err .Error ())
171+ if e , ok := err .(* sdkErrors.TencentCloudSDKError ); ok {
172+ if e .GetCode () == FAILED_OPERATION_PGROUP_IS_UPDATING_ERROR {
173+ return resource .RetryableError (err )
174+ }
175+ }
165176 return tccommon .RetryError (err )
166177 }
167178 log .Printf ("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n " ,
@@ -188,6 +199,11 @@ func resourceTencentCloudCfsAccessRuleDelete(d *schema.ResourceData, meta interf
188199 err := resource .Retry (tccommon .WriteRetryTimeout , func () * resource.RetryError {
189200 errRet := cfsService .DeleteAccessRule (ctx , groupId , ruleId )
190201 if errRet != nil {
202+ if e , ok := errRet .(* sdkErrors.TencentCloudSDKError ); ok {
203+ if e .GetCode () == FAILED_OPERATION_PGROUP_IS_UPDATING_ERROR {
204+ return resource .RetryableError (errRet )
205+ }
206+ }
191207 return tccommon .RetryError (errRet )
192208 }
193209 return nil
0 commit comments