Skip to content

Commit

Permalink
fix(all): support four-layer lb
Browse files Browse the repository at this point in the history
  • Loading branch information
WeiMengXS committed Feb 22, 2024
1 parent acff3be commit 7346b86
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 11 deletions.
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
`

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 7346b86

Please sign in to comment.