@@ -12,6 +12,7 @@ import (
12
12
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
13
13
cfs "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cfs/v20190719"
14
14
15
+ sdkErrors "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors"
15
16
"github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper"
16
17
"github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/ratelimit"
17
18
)
@@ -76,6 +77,11 @@ func resourceTencentCloudCfsAccessRuleCreate(d *schema.ResourceData, meta interf
76
77
if err != nil {
77
78
log .Printf ("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n " ,
78
79
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
+ }
79
85
return tccommon .RetryError (err )
80
86
}
81
87
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
162
168
if err != nil {
163
169
log .Printf ("[CRITAL]%s api[%s] fail, request body [%s], reason[%s]\n " ,
164
170
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
+ }
165
176
return tccommon .RetryError (err )
166
177
}
167
178
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
188
199
err := resource .Retry (tccommon .WriteRetryTimeout , func () * resource.RetryError {
189
200
errRet := cfsService .DeleteAccessRule (ctx , groupId , ruleId )
190
201
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
+ }
191
207
return tccommon .RetryError (errRet )
192
208
}
193
209
return nil
0 commit comments