Skip to content

Commit eb7e505

Browse files
tongyimingmikatong
andauthored
fix cls tags (#1097)
Co-authored-by: mikatong <mikatong@tencent.com>
1 parent 4308d7c commit eb7e505

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

tencentcloud/resource_tc_clb_instance.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,9 +421,11 @@ func resourceTencentCloudClbInstanceCreate(d *schema.ResourceData, meta interfac
421421

422422
if tags := helper.GetTags(d, "tags"); len(tags) > 0 {
423423
for k, v := range tags {
424+
tmpKey := k
425+
tmpValue := v
424426
request.Tags = append(request.Tags, &clb.TagInfo{
425-
TagKey: &k,
426-
TagValue: &v,
427+
TagKey: &tmpKey,
428+
TagValue: &tmpValue,
427429
})
428430
}
429431
}

tencentcloud/resource_tc_clb_instance_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ func TestAccTencentCloudClbInstance_basic(t *testing.T) {
8282
testAccCheckClbInstanceExists("tencentcloud_clb_instance.clb_basic"),
8383
resource.TestCheckResourceAttr("tencentcloud_clb_instance.clb_basic", "network_type", "OPEN"),
8484
resource.TestCheckResourceAttr("tencentcloud_clb_instance.clb_basic", "clb_name", BasicClbName),
85+
resource.TestCheckResourceAttr("tencentcloud_clb_instance.clb_basic", "tags.test", "tf"),
86+
resource.TestCheckResourceAttr("tencentcloud_clb_instance.clb_basic", "tags.test1", "tf1"),
8587
),
8688
},
8789
{
@@ -303,6 +305,7 @@ resource "tencentcloud_clb_instance" "clb_basic" {
303305
clb_name = "` + BasicClbName + `"
304306
tags = {
305307
test = "tf"
308+
test1 = "tf1"
306309
}
307310
}
308311
`

0 commit comments

Comments
 (0)