diff --git a/tencentcloud/services/teo/resource_tc_teo_function_rule.go b/tencentcloud/services/teo/resource_tc_teo_function_rule.go index 5aa829a613..338d199448 100644 --- a/tencentcloud/services/teo/resource_tc_teo_function_rule.go +++ b/tencentcloud/services/teo/resource_tc_teo_function_rule.go @@ -9,6 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + sdkErrors "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors" teov20220901 "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/teo/v20220901" tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common" @@ -183,6 +184,11 @@ func resourceTencentCloudTeoFunctionRuleCreate(d *schema.ResourceData, meta inte err := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError { result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseTeoV20220901Client().CreateFunctionRuleWithContext(ctx, request) if e != nil { + if sdkerr, ok := e.(*sdkErrors.TencentCloudSDKError); ok { + if sdkerr.Code == "ResourceUnavailable.FunctionNotFound" { + return resource.NonRetryableError(e) + } + } return tccommon.RetryError(e) } else { log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString())