Skip to content

Commit b3b8aa8

Browse files
authored
fix(clb): [120625941] tencentcloud_clb_listener_rule support GRPC and GRPCS (#2952)
* add * add
1 parent a37260e commit b3b8aa8

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

.changelog/2952.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
resource/tencentcloud_clb_listener_rule: support set `GRPC` and `GRPCS`
3+
```

tencentcloud/services/clb/extension_clb.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ const (
6767
HEALTH_CHECK_TYPE_HTTP = "HTTP"
6868
HEALTH_CHECK_TYPE_HTTPS = "HTTPS"
6969
HEALTH_CHECK_TYPE_GRPC = "GRPC"
70+
HEALTH_CHECK_TYPE_GRPCS = "GRPCS"
7071
)
7172

7273
var HEALTH_CHECK_TYPE = []string{
@@ -76,6 +77,7 @@ var HEALTH_CHECK_TYPE = []string{
7677
HEALTH_CHECK_TYPE_HTTP,
7778
HEALTH_CHECK_TYPE_HTTPS,
7879
HEALTH_CHECK_TYPE_GRPC,
80+
HEALTH_CHECK_TYPE_GRPCS,
7981
}
8082

8183
const (

tencentcloud/services/clb/resource_tc_clb_listener_rule.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func ResourceTencentCloudClbListenerRule() *schema.Resource {
9393
Optional: true,
9494
Computed: true,
9595
ValidateFunc: tccommon.ValidateAllowedStringValue(HEALTH_CHECK_TYPE),
96-
Description: "Type of health check. Valid value is `CUSTOM`, `TCP`, `HTTP`.",
96+
Description: "Type of health check. Valid value is `CUSTOM`, `PING`, `TCP`, `HTTP`, `HTTPS`, `GRPC`, `GRPCS`.",
9797
},
9898
"health_check_time_out": {
9999
Type: schema.TypeInt,
@@ -176,8 +176,8 @@ func ResourceTencentCloudClbListenerRule() *schema.Resource {
176176
Type: schema.TypeString,
177177
Optional: true,
178178
Computed: true,
179-
ValidateFunc: tccommon.ValidateAllowedStringValue([]string{"HTTP", "HTTPS", "TRPC"}),
180-
Description: "Forwarding protocol between the CLB instance and real server. Valid values: `HTTP`, `HTTPS`, `TRPC`. The default is `HTTP`.",
179+
ValidateFunc: tccommon.ValidateAllowedStringValue([]string{"HTTP", "HTTPS", "GRPC", "GRPCS", "TRPC"}),
180+
Description: "Forwarding protocol between the CLB instance and real server. Valid values: `HTTP`, `HTTPS`, `GRPC`, `GRPCS`, `TRPC`. The default is `HTTP`.",
181181
},
182182
"quic": {
183183
Type: schema.TypeBool,

website/docs/r/clb_listener_rule.html.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ The following arguments are supported:
7171
* `certificate_ssl_mode` - (Optional, String, ForceNew) Type of certificate. Valid values: `UNIDIRECTIONAL`, `MUTUAL`. NOTES: Only supports listeners of HTTPS protocol.
7272
* `domain` - (Optional, String) Domain name of the listener rule. Single domain rules are passed to `domain`, and multi domain rules are passed to `domains`.
7373
* `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`.
74-
* `forward_type` - (Optional, String) Forwarding protocol between the CLB instance and real server. Valid values: `HTTP`, `HTTPS`, `TRPC`. The default is `HTTP`.
74+
* `forward_type` - (Optional, String) Forwarding protocol between the CLB instance and real server. Valid values: `HTTP`, `HTTPS`, `GRPC`, `GRPCS`, `TRPC`. The default is `HTTP`.
7575
* `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`.
7676
* `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.
7777
* `health_check_http_domain` - (Optional, String) Domain name of health check. NOTES: Only supports listeners of `HTTP` and `HTTPS` protocol.
@@ -80,7 +80,7 @@ The following arguments are supported:
8080
* `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`.
8181
* `health_check_switch` - (Optional, Bool) Indicates whether health check is enabled.
8282
* `health_check_time_out` - (Optional, Int) Time out of health check. The value range is [2-60](SEC).
83-
* `health_check_type` - (Optional, String) Type of health check. Valid value is `CUSTOM`, `TCP`, `HTTP`.
83+
* `health_check_type` - (Optional, String) Type of health check. Valid value is `CUSTOM`, `PING`, `TCP`, `HTTP`, `HTTPS`, `GRPC`, `GRPCS`.
8484
* `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`.
8585
* `http2_switch` - (Optional, Bool) Indicate to apply HTTP2.0 protocol or not.
8686
* `quic` - (Optional, Bool) Whether to enable QUIC. Note: QUIC can be enabled only for HTTPS domain names.

0 commit comments

Comments
 (0)