diff --git a/go.mod b/go.mod index fdb45cafbd..a39f4b4ca2 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.856 + 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 @@ -68,8 +68,8 @@ require ( github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/mariadb v1.0.672 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/mongodb v1.0.828 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/monitor v1.0.844 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/organization v1.0.856 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/mps v1.0.853 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/organization v1.0.856 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/postgres v1.0.814 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/privatedns v1.0.815 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/pts v1.0.762 diff --git a/go.sum b/go.sum index 537cd755ce..47dbd60097 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= @@ -959,6 +961,8 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.853 h1:TNYj github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.853/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.856 h1:4PaaKxPjh0dmRzzz0CRZSZlbvzQIPcg4TE1Ibz0Cdlk= 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.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 1399864ca7..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.856" + params["RequestClient"] = "SDK_GO_1.0.860" if requestClient != "" { params["RequestClient"] += ": " + requestClient } diff --git a/vendor/modules.txt b/vendor/modules.txt index 3729a06a16..7cee8c3939 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.856 +# 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