Skip to content

Commit 7f91b75

Browse files
authored
fix(scf): [124298925] tencentcloud_scf_function optmize tags (#3379)
* add * add
1 parent 07f5db1 commit 7f91b75

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

.changelog/3379.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
resource/tencentcloud_scf_function: optmize `tags`
3+
```

tencentcloud/services/scf/resource_tc_scf_function.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -748,20 +748,8 @@ func resourceTencentCloudScfFunctionCreate(d *schema.ResourceData, m interface{}
748748
}
749749
}
750750

751-
// Pass tag as creation param instead of modify and time.Sleep
752751
if tags := helper.GetTags(d, "tags"); len(tags) > 0 {
753752
functionInfo.tags = tags
754-
755-
tagService := svctag.NewTagService(m.(tccommon.ProviderMeta).GetAPIV3Conn())
756-
region := m.(tccommon.ProviderMeta).GetAPIV3Conn().Region
757-
functionId := fmt.Sprintf("%s/function/%s", *functionInfo.namespace, functionInfo.name)
758-
resourceName := tccommon.BuildTagResourceName(SCF_SERVICE, SCF_FUNCTION_RESOURCE_PREFIX, region, functionId)
759-
if err := tagService.ModifyTags(ctx, resourceName, tags, nil); err != nil {
760-
log.Printf("[CRITAL]%s create function tags failed: %+v", logId, err)
761-
return err
762-
}
763-
// wait for tags add successfully
764-
time.Sleep(time.Second)
765753
}
766754

767755
if v, ok := d.GetOk("async_run_enable"); ok && v != nil {

0 commit comments

Comments
 (0)