From 92d81a1f9c6bd588166a3a24531c4ba9d67372b8 Mon Sep 17 00:00:00 2001 From: Wmxs <54929266+WeiMengXS@users.noreply.github.com> Date: Fri, 19 Jan 2024 11:30:55 +0800 Subject: [PATCH 1/8] fix: foceNew --- ...esource_tc_clb_target_group_attachments.go | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/tencentcloud/services/clb/resource_tc_clb_target_group_attachments.go b/tencentcloud/services/clb/resource_tc_clb_target_group_attachments.go index d9b7599856..21e3f0bfdc 100644 --- a/tencentcloud/services/clb/resource_tc_clb_target_group_attachments.go +++ b/tencentcloud/services/clb/resource_tc_clb_target_group_attachments.go @@ -21,7 +21,6 @@ func ResourceTencentCloudClbTargetGroupAttachments() *schema.Resource { return &schema.Resource{ Create: resourceTencentCloudClbTargetGroupAttachmentsCreate, Read: resourceTencentCloudClbTargetGroupAttachmentsRead, - Update: resourceTencentCloudClbTargetGroupAttachmentsUpdate, Delete: resourceTencentCloudClbTargetGroupAttachmentsDelete, Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, @@ -31,15 +30,18 @@ func ResourceTencentCloudClbTargetGroupAttachments() *schema.Resource { "load_balancer_id": { Type: schema.TypeString, Optional: true, + ForceNew: true, Description: "CLB instance ID, (load_balancer_id and target_group_id require at least one).", }, "target_group_id": { Type: schema.TypeString, Optional: true, + ForceNew: true, Description: "Target group ID, (load_balancer_id and target_group_id require at least one).", }, "associations": { Required: true, + ForceNew: true, Type: schema.TypeSet, MaxItems: 20, Description: "Association array, the combination cannot exceed 20.", @@ -203,10 +205,12 @@ func resourceTencentCloudClbTargetGroupAttachmentsRead(d *schema.ResourceData, m _ = d.Set("target_group_id", info[1]) associationsMap["load_balancer_id"] = info[0] } - - associationsMap["listener_id"] = info[2] - associationsMap["location_id"] = info[3] - + if info[2] != "" { + associationsMap["listener_id"] = info[2] + } + if info[3] != "" { + associationsMap["location_id"] = info[3] + } associationsList = append(associationsList, associationsMap) } @@ -215,13 +219,6 @@ func resourceTencentCloudClbTargetGroupAttachmentsRead(d *schema.ResourceData, m return nil } -func resourceTencentCloudClbTargetGroupAttachmentsUpdate(d *schema.ResourceData, meta interface{}) error { - defer tccommon.LogElapsed("resource.tencentcloud_clb_target_group_attachments.update")() - defer tccommon.InconsistentCheck(d, meta)() - - return resourceTencentCloudClbTargetGroupAttachmentsRead(d, meta) -} - func resourceTencentCloudClbTargetGroupAttachmentsDelete(d *schema.ResourceData, meta interface{}) error { defer tccommon.LogElapsed("resource.tencentcloud_clb_target_group_attachments.delete")() defer tccommon.InconsistentCheck(d, meta)() @@ -268,7 +265,9 @@ func parseParamToRequest(d *schema.ResourceData, param string, id string) (assoc targetGroupAssociation := clb.TargetGroupAssociation{} dMap[param] = id for name := range dMap { - setString(name, dMap[name].(string), &targetGroupAssociation) + if dMap[name].(string) != "" { + setString(name, dMap[name].(string), &targetGroupAssociation) + } } associations = append(associations, &targetGroupAssociation) } From ddaa3c2daf962c5706cfdc4f56cdccc52b54c894 Mon Sep 17 00:00:00 2001 From: Wmxs <54929266+WeiMengXS@users.noreply.github.com> Date: Fri, 19 Jan 2024 15:55:28 +0800 Subject: [PATCH 2/8] fix: foceNew --- ...esource_tc_clb_target_group_attachments.go | 3 +- ...ce_tc_clb_target_group_attachments_test.go | 40 +++++++++++++++++++ .../services/clb/service_tencentcloud_clb.go | 1 + 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/tencentcloud/services/clb/resource_tc_clb_target_group_attachments.go b/tencentcloud/services/clb/resource_tc_clb_target_group_attachments.go index 21e3f0bfdc..6246a85cd8 100644 --- a/tencentcloud/services/clb/resource_tc_clb_target_group_attachments.go +++ b/tencentcloud/services/clb/resource_tc_clb_target_group_attachments.go @@ -317,6 +317,7 @@ func margeReadRequest(d *schema.ResourceData) ([]string, map[string]struct{}) { } associationsSet[strings.Join(ids, tccommon.FILED_SP)] = struct{}{} + fmt.Println("create cdr", strings.Join(ids, tccommon.FILED_SP)) } } if len(targetGroupList) < 1 && !isBindFromClb(resourceId) { @@ -330,7 +331,7 @@ func processIds(id string, dMap map[string]interface{}, key string, clbFlag bool } else if !clbFlag && key == "target_group_id" { *ids = append(*ids, id) } else { - if v, ok := dMap[key]; ok { + if v, ok := dMap[key]; ok && v.(string) != "" { *ids = append(*ids, v.(string)) } else { *ids = append(*ids, "null") diff --git a/tencentcloud/services/clb/resource_tc_clb_target_group_attachments_test.go b/tencentcloud/services/clb/resource_tc_clb_target_group_attachments_test.go index 238ba68cfc..cc9838db73 100644 --- a/tencentcloud/services/clb/resource_tc_clb_target_group_attachments_test.go +++ b/tencentcloud/services/clb/resource_tc_clb_target_group_attachments_test.go @@ -67,6 +67,25 @@ func TestAccTencentCloudClbTargetGroupAttachmentsResource_sync(t *testing.T) { }) } +func TestAccTencentCloudClbTargetGroupAttachmentsResource_tcp(t *testing.T) { + t.Parallel() + resource.Test(t, resource.TestCase{ + PreCheck: func() { + tcacctest.AccPreCheck(t) + }, + Providers: tcacctest.AccProviders, + Steps: []resource.TestStep{ + { + Config: testAccClbTargetGroupAttachmentsTCP, + Check: resource.ComposeTestCheckFunc(resource.TestCheckResourceAttrSet("tencentcloud_clb_target_group_attachments.target_group_attachments", "id"), + resource.TestCheckResourceAttrSet("tencentcloud_clb_target_group_attachments.target_group_attachments", "target_group_id"), + resource.TestCheckResourceAttrSet("tencentcloud_clb_target_group_attachments.target_group_attachments", "associations.#"), + ), + }, + }, + }) +} + const testAccClbTargetGroupAttachments = ` resource "tencentcloud_clb_instance" "clb_basic" { @@ -353,3 +372,24 @@ resource "tencentcloud_clb_target_group_attachments" "target_group_attachments1" } } ` +const testAccClbTargetGroupAttachmentsTCP = ` +resource "tencentcloud_clb_instance" "clb_basic" { + network_type = "OPEN" + clb_name = "tf_test_clb_attach_1" + vpc_id = "vpc-efc9vddt" +} +resource "tencentcloud_clb_listener" "public_listeners" { + clb_id = tencentcloud_clb_instance.clb_basic.id + protocol = "TCP" + port = "8090" + listener_name = "iac-test-attach" +} +resource "tencentcloud_clb_target_group_attachments" "target_group_attachments" { + target_group_id = "lbtg-fa1l7oh2" + associations { + load_balancer_id = tencentcloud_clb_instance.clb_basic.id + listener_id = tencentcloud_clb_listener.public_listeners.listener_id + } +} +} +` diff --git a/tencentcloud/services/clb/service_tencentcloud_clb.go b/tencentcloud/services/clb/service_tencentcloud_clb.go index c62f9c2ed3..a77bcb9e43 100644 --- a/tencentcloud/services/clb/service_tencentcloud_clb.go +++ b/tencentcloud/services/clb/service_tencentcloud_clb.go @@ -2335,6 +2335,7 @@ func (me *ClbService) DescribeClbTargetGroupAttachmentsById(ctx context.Context, } key := strings.Join(info, tccommon.FILED_SP) + fmt.Println("read cdr", key) if _, ok := associationsSet[key]; ok { result = append(result, key) } From 65372bc61863789d2c22a4c0df23a55e8d65cbd9 Mon Sep 17 00:00:00 2001 From: Wmxs <54929266+WeiMengXS@users.noreply.github.com> Date: Fri, 19 Jan 2024 17:02:05 +0800 Subject: [PATCH 3/8] feat: doc --- website/docs/r/clb_target_group_attachments.html.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website/docs/r/clb_target_group_attachments.html.markdown b/website/docs/r/clb_target_group_attachments.html.markdown index b5d1b447d7..f50e8245c4 100644 --- a/website/docs/r/clb_target_group_attachments.html.markdown +++ b/website/docs/r/clb_target_group_attachments.html.markdown @@ -45,9 +45,9 @@ resource "tencentcloud_clb_target_group_attachments" "target_group_attachments" The following arguments are supported: -* `associations` - (Required, Set) Association array, the combination cannot exceed 20. -* `load_balancer_id` - (Optional, String) CLB instance ID, (load_balancer_id and target_group_id require at least one). -* `target_group_id` - (Optional, String) Target group ID, (load_balancer_id and target_group_id require at least one). +* `associations` - (Required, Set, ForceNew) Association array, the combination cannot exceed 20. +* `load_balancer_id` - (Optional, String, ForceNew) CLB instance ID, (load_balancer_id and target_group_id require at least one). +* `target_group_id` - (Optional, String, ForceNew) Target group ID, (load_balancer_id and target_group_id require at least one). The `associations` object supports the following: From 124f5305f9c44f32dc9b347350205bc25e1f046a Mon Sep 17 00:00:00 2001 From: Wmxs <54929266+WeiMengXS@users.noreply.github.com> Date: Fri, 26 Jan 2024 16:24:04 +0800 Subject: [PATCH 4/8] feat: forceNew --- .../services/clb/resource_tc_clb_target_group_attachments.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tencentcloud/services/clb/resource_tc_clb_target_group_attachments.go b/tencentcloud/services/clb/resource_tc_clb_target_group_attachments.go index 6246a85cd8..653c2beb04 100644 --- a/tencentcloud/services/clb/resource_tc_clb_target_group_attachments.go +++ b/tencentcloud/services/clb/resource_tc_clb_target_group_attachments.go @@ -50,20 +50,24 @@ func ResourceTencentCloudClbTargetGroupAttachments() *schema.Resource { "load_balancer_id": { Type: schema.TypeString, Optional: true, + ForceNew: true, Description: "CLB instance ID, when the binding target is target group, load_balancer_id in associations is required.", }, "target_group_id": { Type: schema.TypeString, Optional: true, + ForceNew: true, Description: "Target group ID, when the binding target is clb, the target_group_id in associations is required.", }, "listener_id": { Type: schema.TypeString, + ForceNew: true, Optional: true, Description: "Listener ID.", }, "location_id": { Type: schema.TypeString, + ForceNew: true, Optional: true, Description: "Forwarding rule ID.", }, From 3177b458997f93434d7e5b8da3ceca3a92311e93 Mon Sep 17 00:00:00 2001 From: Wmxs <54929266+WeiMengXS@users.noreply.github.com> Date: Thu, 22 Feb 2024 13:17:12 +0800 Subject: [PATCH 5/8] fix(all): support four-layer lb --- go.mod | 4 ++-- go.sum | 4 ++++ .../clb/resource_tc_clb_target_group_attachments.go | 7 ++++--- .../clb/resource_tc_clb_target_group_attachments_test.go | 4 ++-- .../tencentcloud/common/http/request.go | 2 +- vendor/modules.txt | 4 ++-- 6 files changed, 15 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index b387aa1d25..0a237aa033 100644 --- a/go.mod +++ b/go.mod @@ -43,10 +43,10 @@ require ( github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/chdfs v1.0.600 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ciam v1.0.695 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka v1.0.748 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.847 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.860 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cloudaudit v1.0.544 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls v1.0.711 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.859 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.860 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.624 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cwp v1.0.762 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cynosdb v1.0.692 diff --git a/go.sum b/go.sum index b045dfbaf3..6b3bc0b924 100644 --- a/go.sum +++ b/go.sum @@ -868,6 +868,8 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.693 h1:3eI2Ciq github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.693/go.mod h1:WhFqrn14QuRHB01xA5Q9sC+xw73BpqSE5+ZnqEznCW8= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.847 h1:VfUval30/CDPnvS5KpvTpM6v7HcErCgwPTsyN9VDqpM= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.847/go.mod h1:zR4WM8Cg+v4daLgPLfmmzFrXCQFrQYIn+7DqBL60uRc= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.860 h1:P2TPFCB1oyJ6yOTgFDBdKByepog3iMg2fIUN/VHo9EM= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.860/go.mod h1:eTGN2Qz4NxaYl+CwMpcj4vNImNOr74NC8WTCLSJN8Ks= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cloudaudit v1.0.544 h1:ApY6rS7I9otgujOdAFy0+Epno1PNVCQmsOoWQxx724Y= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cloudaudit v1.0.544/go.mod h1:c37rIdL3LrJXYwrfp9c8L4MabTqKIZUe1xvnWhN75oc= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls v1.0.711 h1:v6ffPkv3kmT6bC0d3JLVVJsh61zdvaLJZ5RHwmKNBHk= @@ -961,6 +963,8 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.856 h1:4Paa github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.856/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.859 h1:XXpytsYJilIk/koSWmpEcDZBILNqeEUprU9L5gqbA00= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.859/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.860 h1:d5/YwGX6b5YgFU/0thsbs5aBp4aJJXBi7JyU1JHAaw0= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.860/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.624 h1:nEZqsoqt1pEoaP9JjkHQy3/H00suCfzlHW1qOm2nYD8= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.624/go.mod h1:+TXSVyeKwt1IhZRqKPbTREteBcP+K07Q846/ilNzLWA= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cwp v1.0.762 h1:2egy69SP/wPsmnfozcQVZ6tUY6F6N/TpEe/7xtXrc/8= diff --git a/tencentcloud/services/clb/resource_tc_clb_target_group_attachments.go b/tencentcloud/services/clb/resource_tc_clb_target_group_attachments.go index 653c2beb04..8905953195 100644 --- a/tencentcloud/services/clb/resource_tc_clb_target_group_attachments.go +++ b/tencentcloud/services/clb/resource_tc_clb_target_group_attachments.go @@ -209,10 +209,10 @@ func resourceTencentCloudClbTargetGroupAttachmentsRead(d *schema.ResourceData, m _ = d.Set("target_group_id", info[1]) associationsMap["load_balancer_id"] = info[0] } - if info[2] != "" { + if info[2] != "" && info[2] != "null" { associationsMap["listener_id"] = info[2] } - if info[3] != "" { + if info[3] != "" && info[3] != "null" { associationsMap["location_id"] = info[3] } associationsList = append(associationsList, associationsMap) @@ -269,7 +269,8 @@ func parseParamToRequest(d *schema.ResourceData, param string, id string) (assoc targetGroupAssociation := clb.TargetGroupAssociation{} dMap[param] = id for name := range dMap { - if dMap[name].(string) != "" { + fmt.Println(name, dMap[name]) + if dMap[name] != nil && dMap[name].(string) != "" { setString(name, dMap[name].(string), &targetGroupAssociation) } } diff --git a/tencentcloud/services/clb/resource_tc_clb_target_group_attachments_test.go b/tencentcloud/services/clb/resource_tc_clb_target_group_attachments_test.go index cc9838db73..c3364492c3 100644 --- a/tencentcloud/services/clb/resource_tc_clb_target_group_attachments_test.go +++ b/tencentcloud/services/clb/resource_tc_clb_target_group_attachments_test.go @@ -383,13 +383,13 @@ resource "tencentcloud_clb_listener" "public_listeners" { protocol = "TCP" port = "8090" listener_name = "iac-test-attach" + target_type = "TARGETGROUP" } resource "tencentcloud_clb_target_group_attachments" "target_group_attachments" { - target_group_id = "lbtg-fa1l7oh2" + target_group_id = "lbtg-nxd0dmcm" associations { load_balancer_id = tencentcloud_clb_instance.clb_basic.id listener_id = tencentcloud_clb_listener.public_listeners.listener_id } } -} ` diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http/request.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http/request.go index 2d0e781955..80caf9eb3a 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http/request.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http/request.go @@ -265,7 +265,7 @@ func CompleteCommonParams(request Request, region string, requestClient string) params["Action"] = request.GetAction() params["Timestamp"] = strconv.FormatInt(time.Now().Unix(), 10) params["Nonce"] = strconv.Itoa(rand.Int()) - params["RequestClient"] = "SDK_GO_1.0.859" + params["RequestClient"] = "SDK_GO_1.0.860" if requestClient != "" { params["RequestClient"] += ": " + requestClient } diff --git a/vendor/modules.txt b/vendor/modules.txt index d3027fda8e..633b9b7a8d 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1148,7 +1148,7 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ciam/v20220331 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka v1.0.748 ## explicit; go 1.14 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka/v20190819 -# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.847 +# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.860 ## explicit; go 1.14 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb/v20180317 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cloudaudit v1.0.544 @@ -1157,7 +1157,7 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cloudaudit/v20190319 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls v1.0.711 ## explicit; go 1.14 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls/v20201016 -# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.859 +# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.860 ## explicit; go 1.11 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors From 0a81efb888d9f9e43c05912f4cd1ae9dbaf90dcd Mon Sep 17 00:00:00 2001 From: Wmxs <54929266+WeiMengXS@users.noreply.github.com> Date: Thu, 22 Feb 2024 14:24:50 +0800 Subject: [PATCH 6/8] fix(all): support four-layer lb --- website/docs/r/clb_target_group_attachments.html.markdown | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/website/docs/r/clb_target_group_attachments.html.markdown b/website/docs/r/clb_target_group_attachments.html.markdown index f50e8245c4..1a96726de8 100644 --- a/website/docs/r/clb_target_group_attachments.html.markdown +++ b/website/docs/r/clb_target_group_attachments.html.markdown @@ -51,10 +51,10 @@ The following arguments are supported: The `associations` object supports the following: -* `listener_id` - (Optional, String) Listener ID. -* `load_balancer_id` - (Optional, String) CLB instance ID, when the binding target is target group, load_balancer_id in associations is required. -* `location_id` - (Optional, String) Forwarding rule ID. -* `target_group_id` - (Optional, String) Target group ID, when the binding target is clb, the target_group_id in associations is required. +* `listener_id` - (Optional, String, ForceNew) Listener ID. +* `load_balancer_id` - (Optional, String, ForceNew) CLB instance ID, when the binding target is target group, load_balancer_id in associations is required. +* `location_id` - (Optional, String, ForceNew) Forwarding rule ID. +* `target_group_id` - (Optional, String, ForceNew) Target group ID, when the binding target is clb, the target_group_id in associations is required. ## Attributes Reference From b70083556586c947b8b4919132e5eaa12da21193 Mon Sep 17 00:00:00 2001 From: Wmxs <54929266+WeiMengXS@users.noreply.github.com> Date: Thu, 22 Feb 2024 15:56:05 +0800 Subject: [PATCH 7/8] fix(all): support four-layer lb --- .../services/clb/resource_tc_clb_target_group_attachments.go | 2 -- tencentcloud/services/clb/service_tencentcloud_clb.go | 1 - 2 files changed, 3 deletions(-) diff --git a/tencentcloud/services/clb/resource_tc_clb_target_group_attachments.go b/tencentcloud/services/clb/resource_tc_clb_target_group_attachments.go index 8905953195..e9a18e59ec 100644 --- a/tencentcloud/services/clb/resource_tc_clb_target_group_attachments.go +++ b/tencentcloud/services/clb/resource_tc_clb_target_group_attachments.go @@ -269,7 +269,6 @@ func parseParamToRequest(d *schema.ResourceData, param string, id string) (assoc targetGroupAssociation := clb.TargetGroupAssociation{} dMap[param] = id for name := range dMap { - fmt.Println(name, dMap[name]) if dMap[name] != nil && dMap[name].(string) != "" { setString(name, dMap[name].(string), &targetGroupAssociation) } @@ -322,7 +321,6 @@ func margeReadRequest(d *schema.ResourceData) ([]string, map[string]struct{}) { } associationsSet[strings.Join(ids, tccommon.FILED_SP)] = struct{}{} - fmt.Println("create cdr", strings.Join(ids, tccommon.FILED_SP)) } } if len(targetGroupList) < 1 && !isBindFromClb(resourceId) { diff --git a/tencentcloud/services/clb/service_tencentcloud_clb.go b/tencentcloud/services/clb/service_tencentcloud_clb.go index a77bcb9e43..c62f9c2ed3 100644 --- a/tencentcloud/services/clb/service_tencentcloud_clb.go +++ b/tencentcloud/services/clb/service_tencentcloud_clb.go @@ -2335,7 +2335,6 @@ func (me *ClbService) DescribeClbTargetGroupAttachmentsById(ctx context.Context, } key := strings.Join(info, tccommon.FILED_SP) - fmt.Println("read cdr", key) if _, ok := associationsSet[key]; ok { result = append(result, key) } From 9c00e63ae25a242da43d81a291a76faa10b9e086 Mon Sep 17 00:00:00 2001 From: Wmxs <54929266+WeiMengXS@users.noreply.github.com> Date: Fri, 23 Feb 2024 10:29:24 +0800 Subject: [PATCH 8/8] fix(clb): supporting four-layer LB --- .changelog/2489.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/2489.txt diff --git a/.changelog/2489.txt b/.changelog/2489.txt new file mode 100644 index 0000000000..402fa05432 --- /dev/null +++ b/.changelog/2489.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/tencentcloud_clb_target_group_attachments: Fixed the problem of not supporting four-layer LB +```