Skip to content

Commit 05c1dbb

Browse files
authored
add rule quic (#2406)
* add rule quic * add parameter quic
1 parent 269c83c commit 05c1dbb

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

.changelog/2406.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: Add parameter `quic`.
3+
```

tencentcloud/resource_tc_clb_listener_rule.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,12 @@ func resourceTencentCloudClbListenerRule() *schema.Resource {
163163
ValidateFunc: validateAllowedStringValue([]string{"HTTP", "HTTPS", "TRPC"}),
164164
Description: "Forwarding protocol between the CLB instance and real server. Valid values: `HTTP`, `HTTPS`, `TRPC`. The default is `HTTP`.",
165165
},
166+
"quic": {
167+
Type: schema.TypeBool,
168+
Optional: true,
169+
Computed: true,
170+
Description: "Whether to enable QUIC. Note: QUIC can be enabled only for HTTPS domain names.",
171+
},
166172
//computed
167173
"rule_id": {
168174
Type: schema.TypeString,
@@ -264,6 +270,10 @@ func resourceTencentCloudClbListenerRuleCreate(d *schema.ResourceData, meta inte
264270
rule.Certificate = certificateInput
265271
}
266272

273+
if v, ok := d.GetOkExists("quic"); ok {
274+
rule.Quic = helper.Bool(v.(bool))
275+
}
276+
267277
request.Rules = []*clb.RuleInput{&rule}
268278

269279
err = resource.Retry(writeRetryTimeout, func() *resource.RetryError {
@@ -401,6 +411,14 @@ func resourceTencentCloudClbListenerRuleRead(d *schema.ResourceData, meta interf
401411
_ = d.Set("forward_type", instance.ForwardType)
402412
_ = d.Set("http2_switch", instance.Http2)
403413

414+
if instance.QuicStatus != nil {
415+
if *instance.QuicStatus == "QUIC_ACTIVE" {
416+
_ = d.Set("quic", true)
417+
} else {
418+
_ = d.Set("quic", false)
419+
}
420+
}
421+
404422
//health check
405423
if instance.HealthCheck != nil {
406424
health_check_switch := false
@@ -576,6 +594,13 @@ func resourceTencentCloudClbListenerRuleUpdate(d *schema.ResourceData, meta inte
576594
}
577595
}
578596

597+
if d.HasChange("quic") {
598+
domainChanged = true
599+
if v, ok := d.GetOkExists("quic"); ok {
600+
domainRequest.Quic = helper.Bool(v.(bool))
601+
}
602+
}
603+
579604
if domainChanged {
580605
domainRequest.ListenerId = &listenerId
581606
domainRequest.LoadBalancerId = &clbId

website/docs/r/clb_listener_rule.html.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ The following arguments are supported:
6060
* `health_check_type` - (Optional, String) Type of health check. Valid value is `CUSTOM`, `TCP`, `HTTP`.
6161
* `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`.
6262
* `http2_switch` - (Optional, Bool) Indicate to apply HTTP2.0 protocol or not.
63+
* `quic` - (Optional, Bool) Whether to enable QUIC. Note: QUIC can be enabled only for HTTPS domain names.
6364
* `scheduler` - (Optional, String) Scheduling method of the CLB listener rules. Valid values: `WRR`, `IP HASH`, `LEAST_CONN`. The default is `WRR`. NOTES: TCP/UDP/TCP_SSL listener allows direct configuration, HTTP/HTTPS listener needs to be configured in `tencentcloud_clb_listener_rule`.
6465
* `session_expire_time` - (Optional, Int) Time of session persistence within the CLB listener. NOTES: Available when scheduler is specified as `WRR`, and not available when listener protocol is `TCP_SSL`. NOTES: TCP/UDP/TCP_SSL listener allows direct configuration, HTTP/HTTPS listener needs to be configured in `tencentcloud_clb_listener_rule`.
6566
* `target_type` - (Optional, String, ForceNew) Backend target type. Valid values: `NODE`, `TARGETGROUP`. `NODE` means to bind ordinary nodes, `TARGETGROUP` means to bind target group.

0 commit comments

Comments
 (0)