Skip to content

fix(gaap): [123456789] connect_timeout support tcp and udp #2818

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 11, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func ResourceTencentCloudGaapLayer4Listener() *schema.Resource {
Optional: true,
Default: 2,
ValidateFunc: tccommon.ValidateIntegerInRange(2, 60),
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`.",
Description: "Timeout of the health check response, should less than interval, default value is 2s. NOTES: Require less than `interval`.",
},
"healthy_threshold": {
Type: schema.TypeInt,
Expand Down Expand Up @@ -215,8 +215,7 @@ func resourceTencentCloudGaapLayer4ListenerCreate(d *schema.ResourceData, m inte
healthyThreshold := d.Get("healthy_threshold").(int)
unhealthyThreshold := d.Get("unhealthy_threshold").(int)

// only check for TCP listener
if protocol == "TCP" && connectTimeout >= interval {
if connectTimeout >= interval {
return errors.New("connect_timeout must be less than interval")
}
clientIPMethod := d.Get("client_ip_method").(int)
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/gaap_layer4_listener.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ The following arguments are supported:
* `check_port` - (Optional, Int) UDP origin station health check probe port.
* `check_type` - (Optional, String) UDP origin server health type. PORT means check port, and PING means PING.
* `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.
* `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`.
* `connect_timeout` - (Optional, Int) Timeout of the health check response, should less than interval, default value is 2s. NOTES: Require less than `interval`.
* `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.
* `health_check` - (Optional, Bool) Indicates whether health check is enable, default value is `false`.
* `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.
Expand Down
Loading