Skip to content

fix(clb): [120625941] tencentcloud_clb_listener_rule support GRPC and GRPCS #2952

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 2 commits into from
Nov 13, 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
3 changes: 3 additions & 0 deletions .changelog/2952.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/tencentcloud_clb_listener_rule: support set `GRPC` and `GRPCS`
```
2 changes: 2 additions & 0 deletions tencentcloud/services/clb/extension_clb.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ const (
HEALTH_CHECK_TYPE_HTTP = "HTTP"
HEALTH_CHECK_TYPE_HTTPS = "HTTPS"
HEALTH_CHECK_TYPE_GRPC = "GRPC"
HEALTH_CHECK_TYPE_GRPCS = "GRPCS"
)

var HEALTH_CHECK_TYPE = []string{
Expand All @@ -76,6 +77,7 @@ var HEALTH_CHECK_TYPE = []string{
HEALTH_CHECK_TYPE_HTTP,
HEALTH_CHECK_TYPE_HTTPS,
HEALTH_CHECK_TYPE_GRPC,
HEALTH_CHECK_TYPE_GRPCS,
}

const (
Expand Down
6 changes: 3 additions & 3 deletions tencentcloud/services/clb/resource_tc_clb_listener_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func ResourceTencentCloudClbListenerRule() *schema.Resource {
Optional: true,
Computed: true,
ValidateFunc: tccommon.ValidateAllowedStringValue(HEALTH_CHECK_TYPE),
Description: "Type of health check. Valid value is `CUSTOM`, `TCP`, `HTTP`.",
Description: "Type of health check. Valid value is `CUSTOM`, `PING`, `TCP`, `HTTP`, `HTTPS`, `GRPC`, `GRPCS`.",
},
"health_check_time_out": {
Type: schema.TypeInt,
Expand Down Expand Up @@ -176,8 +176,8 @@ func ResourceTencentCloudClbListenerRule() *schema.Resource {
Type: schema.TypeString,
Optional: true,
Computed: true,
ValidateFunc: tccommon.ValidateAllowedStringValue([]string{"HTTP", "HTTPS", "TRPC"}),
Description: "Forwarding protocol between the CLB instance and real server. Valid values: `HTTP`, `HTTPS`, `TRPC`. The default is `HTTP`.",
ValidateFunc: tccommon.ValidateAllowedStringValue([]string{"HTTP", "HTTPS", "GRPC", "GRPCS", "TRPC"}),
Description: "Forwarding protocol between the CLB instance and real server. Valid values: `HTTP`, `HTTPS`, `GRPC`, `GRPCS`, `TRPC`. The default is `HTTP`.",
},
"quic": {
Type: schema.TypeBool,
Expand Down
4 changes: 2 additions & 2 deletions website/docs/r/clb_listener_rule.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ The following arguments are supported:
* `certificate_ssl_mode` - (Optional, String, ForceNew) Type of certificate. Valid values: `UNIDIRECTIONAL`, `MUTUAL`. NOTES: Only supports listeners of HTTPS protocol.
* `domain` - (Optional, String) Domain name of the listener rule. Single domain rules are passed to `domain`, and multi domain rules are passed to `domains`.
* `domains` - (Optional, List: [`String`], ForceNew) Domain name list of the listener rule. Single domain rules are passed to `domain`, and multi domain rules are passed to `domains`.
* `forward_type` - (Optional, String) Forwarding protocol between the CLB instance and real server. Valid values: `HTTP`, `HTTPS`, `TRPC`. The default is `HTTP`.
* `forward_type` - (Optional, String) Forwarding protocol between the CLB instance and real server. Valid values: `HTTP`, `HTTPS`, `GRPC`, `GRPCS`, `TRPC`. The default is `HTTP`.
* `health_check_health_num` - (Optional, Int) Health threshold of health check, and the default is `3`. If a success result is returned for the health check 3 consecutive times, indicates that the forwarding is normal. The value range is [2-10]. NOTES: TCP/UDP/TCP_SSL listener allows direct configuration, HTTP/HTTPS listener needs to be configured in `tencentcloud_clb_listener_rule`.
* `health_check_http_code` - (Optional, Int) HTTP Status Code. The default is 31. Valid value ranges: [1~31]. `1 means the return value '1xx' is health. `2` means the return value '2xx' is health. `4` means the return value '3xx' is health. `8` means the return value '4xx' is health. 16 means the return value '5xx' is health. If you want multiple return codes to indicate health, need to add the corresponding values. NOTES: The 'HTTP' health check of the 'TCP' listener only supports specifying one health check status code. NOTES: Only supports listeners of 'HTTP' and 'HTTPS' protocol.
* `health_check_http_domain` - (Optional, String) Domain name of health check. NOTES: Only supports listeners of `HTTP` and `HTTPS` protocol.
Expand All @@ -80,7 +80,7 @@ The following arguments are supported:
* `health_check_interval_time` - (Optional, Int) Interval time of health check. Valid value ranges: (2~300) sec. and the default is `5` sec. NOTES: TCP/UDP/TCP_SSL listener allows direct configuration, HTTP/HTTPS listener needs to be configured in `tencentcloud_clb_listener_rule`.
* `health_check_switch` - (Optional, Bool) Indicates whether health check is enabled.
* `health_check_time_out` - (Optional, Int) Time out of health check. The value range is [2-60](SEC).
* `health_check_type` - (Optional, String) Type of health check. Valid value is `CUSTOM`, `TCP`, `HTTP`.
* `health_check_type` - (Optional, String) Type of health check. Valid value is `CUSTOM`, `PING`, `TCP`, `HTTP`, `HTTPS`, `GRPC`, `GRPCS`.
* `health_check_unhealth_num` - (Optional, Int) Unhealthy threshold of health check, and the default is `3`. If the unhealthy result is returned 3 consecutive times, indicates that the forwarding is abnormal. The value range is [2-10]. NOTES: TCP/UDP/TCP_SSL listener allows direct configuration, HTTP/HTTPS listener needs to be configured in `tencentcloud_clb_listener_rule`.
* `http2_switch` - (Optional, Bool) Indicate to apply HTTP2.0 protocol or not.
* `quic` - (Optional, Bool) Whether to enable QUIC. Note: QUIC can be enabled only for HTTPS domain names.
Expand Down
Loading