Skip to content

Commit adf912f

Browse files
authored
fix: modify tag (#2434)
* fix: modify tag * fix: Fix tag problem
1 parent 0fe01ec commit adf912f

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

.changelog/2434.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_mariadb_hour_db_instance: Fix tag problem
3+
```

tencentcloud/services/mariadb/resource_tc_mariadb_hour_db_instance.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ func resourceTencentCloudMariadbHourDbInstanceCreate(d *schema.ResourceData, met
205205
if tags := helper.GetTags(d, "tags"); len(tags) > 0 {
206206
tagService := svctag.NewTagService(meta.(tccommon.ProviderMeta).GetAPIV3Conn())
207207
region := meta.(tccommon.ProviderMeta).GetAPIV3Conn().Region
208-
resourceName := fmt.Sprintf("qcs::mariadb:%s:uin/:mariadb-hour-instance/%s", region, instanceId)
208+
resourceName := fmt.Sprintf("qcs::mariadb:%s:uin/:instance/%s", region, instanceId)
209209
if err = tagService.ModifyTags(ctx, resourceName, tags, nil); err != nil {
210210
return err
211211
}
@@ -282,7 +282,7 @@ func resourceTencentCloudMariadbHourDbInstanceRead(d *schema.ResourceData, meta
282282

283283
tcClient := meta.(tccommon.ProviderMeta).GetAPIV3Conn()
284284
tagService := svctag.NewTagService(tcClient)
285-
tags, err := tagService.DescribeResourceTags(ctx, "mariadb", "mariadb-hour-instance", tcClient.Region, instanceId)
285+
tags, err := tagService.DescribeResourceTags(ctx, "mariadb", "instance", tcClient.Region, instanceId)
286286
if err != nil {
287287
return err
288288
}
@@ -360,7 +360,7 @@ func resourceTencentCloudMariadbHourDbInstanceUpdate(d *schema.ResourceData, met
360360
tagService := svctag.NewTagService(tcClient)
361361
oldTags, newTags := d.GetChange("tags")
362362
replaceTags, deleteTags := svctag.DiffTags(oldTags.(map[string]interface{}), newTags.(map[string]interface{}))
363-
resourceName := tccommon.BuildTagResourceName("mariadb", "mariadb-hour-instance", tcClient.Region, d.Id())
363+
resourceName := tccommon.BuildTagResourceName("mariadb", "instance", tcClient.Region, d.Id())
364364
if err := tagService.ModifyTags(ctx, resourceName, replaceTags, deleteTags); err != nil {
365365
return err
366366
}

0 commit comments

Comments
 (0)