Skip to content

Commit 966bc04

Browse files
author
mikatong
committed
connect_timeout support tcp and udp
1 parent cdca111 commit 966bc04

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

tencentcloud/services/gaap/resource_tc_gaap_layer4_listener.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func ResourceTencentCloudGaapLayer4Listener() *schema.Resource {
8181
Optional: true,
8282
Default: 2,
8383
ValidateFunc: tccommon.ValidateIntegerInRange(2, 60),
84-
Description: "Timeout of the health check response, should less than interval, default value is 2s. NOTES: Only supports listeners of `TCP` protocol and require less than `interval`.",
84+
Description: "Timeout of the health check response, should less than interval, default value is 2s. NOTES: Require less than `interval`.",
8585
},
8686
"healthy_threshold": {
8787
Type: schema.TypeInt,
@@ -215,8 +215,7 @@ func resourceTencentCloudGaapLayer4ListenerCreate(d *schema.ResourceData, m inte
215215
healthyThreshold := d.Get("healthy_threshold").(int)
216216
unhealthyThreshold := d.Get("unhealthy_threshold").(int)
217217

218-
// only check for TCP listener
219-
if protocol == "TCP" && connectTimeout >= interval {
218+
if connectTimeout >= interval {
220219
return errors.New("connect_timeout must be less than interval")
221220
}
222221
clientIPMethod := d.Get("client_ip_method").(int)

website/docs/r/gaap_layer4_listener.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ The following arguments are supported:
6666
* `check_port` - (Optional, Int) UDP origin station health check probe port.
6767
* `check_type` - (Optional, String) UDP origin server health type. PORT means check port, and PING means PING.
6868
* `client_ip_method` - (Optional, Int, ForceNew) The way the listener gets the client IP, 0 for TOA, 1 for Proxy Protocol, default value is 0. NOTES: Only supports listeners of `TCP` protocol.
69-
* `connect_timeout` - (Optional, Int) Timeout of the health check response, should less than interval, default value is 2s. NOTES: Only supports listeners of `TCP` protocol and require less than `interval`.
69+
* `connect_timeout` - (Optional, Int) Timeout of the health check response, should less than interval, default value is 2s. NOTES: Require less than `interval`.
7070
* `context_type` - (Optional, String) UDP source station health check port probe message type: TEXT represents text. Only used when the health check type is PORT.
7171
* `health_check` - (Optional, Bool) Indicates whether health check is enable, default value is `false`.
7272
* `healthy_threshold` - (Optional, Int) Health threshold, which indicates how many consecutive inspections are successful, the source station is determined to be healthy. Range from 1 to 10. Default value is 1.

0 commit comments

Comments
 (0)