Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ require (
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cdn v1.0.425
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cfs v1.0.199
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka v1.0.403
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.283
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.445
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cloudaudit v1.0.199
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls v1.0.412
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.445
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,8 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka v1.0.403 h1:rD9H
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka v1.0.403/go.mod h1:yWwwGj2gV0hRPfM9GXG4EgDee0cEWYcAwl/M8CTTvzM=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.283 h1:8pML0UtXgui5WZFLLrCv6QdR8e0fUva0V4W5wSgTCSc=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.283/go.mod h1:zgARzAnsLzpLhdpAHrHTUilOXytH9aEJy5ssCdizVV0=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.445 h1:ZUtZLAXy7xQbDipfEIPEBahjHBoJ+hTAbQYaqjiwFAg=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.445/go.mod h1:qiBToiXBl7c0k05B3ZzLlAdPuDl5sFHzYsnB8/IBRiA=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cloudaudit v1.0.199 h1:o41qFAFJGPDTLNWXs7nLw4fsDxFUCe5gkO2YXI9Ye6Q=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cloudaudit v1.0.199/go.mod h1:b7dNjabPys0/iLwRFd8MVE5EkJTNAh4qtaHQOOLchx4=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls v1.0.412 h1:mQbC16tarrfz+ILlHTMiiA3MTUP79fSqs+KEpuL2FKE=
Expand Down
6 changes: 6 additions & 0 deletions tencentcloud/resource_tc_clb_listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,12 @@ func resourceTencentCloudClbListenerUpdate(d *schema.ResourceData, meta interfac
request.Certificate = certificateInput
}

if d.HasChange("target_type") {
changed = true
targetType := d.Get("target_type").(string)
request.TargetType = helper.String(targetType)
}

if changed {
err := resource.Retry(writeRetryTimeout, func() *resource.RetryError {
response, e := meta.(*TencentCloudClient).apiV3Conn.UseClbClient().ModifyListener(request)
Expand Down
6 changes: 4 additions & 2 deletions tencentcloud/resource_tc_clb_listener_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func TestAccTencentCloudClbListener_basic(t *testing.T) {
})
}

func TestAccTencentCloudClbListener_tcp(t *testing.T) {
func TestAccTencentCloudClbListener_tcp_basic(t *testing.T) {
t.Parallel()

resource.Test(t, resource.TestCase{
Expand All @@ -63,6 +63,7 @@ func TestAccTencentCloudClbListener_tcp(t *testing.T) {
resource.TestCheckResourceAttr("tencentcloud_clb_listener.listener_tcp", "health_check_interval_time", "100"),
resource.TestCheckResourceAttr("tencentcloud_clb_listener.listener_tcp", "health_check_health_num", "2"),
resource.TestCheckResourceAttr("tencentcloud_clb_listener.listener_tcp", "health_check_unhealth_num", "2"),
resource.TestCheckResourceAttr("tencentcloud_clb_listener.listener_tcp", "target_type", "NODE"),
),
},
{
Expand All @@ -80,6 +81,7 @@ func TestAccTencentCloudClbListener_tcp(t *testing.T) {
resource.TestCheckResourceAttr("tencentcloud_clb_listener.listener_tcp", "health_check_interval_time", "200"),
resource.TestCheckResourceAttr("tencentcloud_clb_listener.listener_tcp", "health_check_health_num", "3"),
resource.TestCheckResourceAttr("tencentcloud_clb_listener.listener_tcp", "health_check_unhealth_num", "3"),
resource.TestCheckResourceAttr("tencentcloud_clb_listener.listener_tcp", "target_type", "TARGETGROUP"),
),
},
{
Expand Down Expand Up @@ -459,7 +461,7 @@ resource "tencentcloud_clb_listener" "listener_tcp" {
health_check_unhealth_num = 2
session_expire_time = 30
scheduler = "WRR"
target_type = "TARGETGROUP"
target_type = "NODE"
}
`

Expand Down
Loading