diff --git a/.changelog/3379.txt b/.changelog/3379.txt new file mode 100644 index 0000000000..70ac2b3738 --- /dev/null +++ b/.changelog/3379.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/tencentcloud_scf_function: optmize `tags` +``` diff --git a/tencentcloud/services/scf/resource_tc_scf_function.go b/tencentcloud/services/scf/resource_tc_scf_function.go index df3cd500cf..367dfb5e98 100644 --- a/tencentcloud/services/scf/resource_tc_scf_function.go +++ b/tencentcloud/services/scf/resource_tc_scf_function.go @@ -748,20 +748,8 @@ func resourceTencentCloudScfFunctionCreate(d *schema.ResourceData, m interface{} } } - // Pass tag as creation param instead of modify and time.Sleep if tags := helper.GetTags(d, "tags"); len(tags) > 0 { functionInfo.tags = tags - - tagService := svctag.NewTagService(m.(tccommon.ProviderMeta).GetAPIV3Conn()) - region := m.(tccommon.ProviderMeta).GetAPIV3Conn().Region - functionId := fmt.Sprintf("%s/function/%s", *functionInfo.namespace, functionInfo.name) - resourceName := tccommon.BuildTagResourceName(SCF_SERVICE, SCF_FUNCTION_RESOURCE_PREFIX, region, functionId) - if err := tagService.ModifyTags(ctx, resourceName, tags, nil); err != nil { - log.Printf("[CRITAL]%s create function tags failed: %+v", logId, err) - return err - } - // wait for tags add successfully - time.Sleep(time.Second) } if v, ok := d.GetOk("async_run_enable"); ok && v != nil {