Skip to content

Commit 99e53b6

Browse files
committed
add
1 parent e582219 commit 99e53b6

File tree

2 files changed

+33
-7
lines changed

2 files changed

+33
-7
lines changed

.changelog/2789.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 `domains`
3+
```

website/docs/r/clb_listener_rule.html.markdown

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,21 @@ Provides a resource to create a CLB listener rule.
1515

1616
## Example Usage
1717

18+
### Create a single domain listener rule
19+
1820
```hcl
19-
resource "tencentcloud_clb_listener_rule" "foo" {
21+
resource "tencentcloud_clb_listener_rule" "example" {
2022
listener_id = "lbl-hh141sn9"
2123
clb_id = "lb-k2zjp9lv"
22-
domain = "foo.net"
23-
url = "/bar"
24+
domain = "example.com"
25+
url = "/"
2426
health_check_switch = true
2527
health_check_interval_time = 5
2628
health_check_health_num = 3
2729
health_check_unhealth_num = 3
2830
health_check_http_code = 2
29-
health_check_http_path = "Default Path"
30-
health_check_http_domain = "Default Domain"
31+
health_check_http_path = "/"
32+
health_check_http_domain = "check.com"
3133
health_check_http_method = "GET"
3234
certificate_ssl_mode = "MUTUAL"
3335
certificate_id = "VjANRdz8"
@@ -37,17 +39,38 @@ resource "tencentcloud_clb_listener_rule" "foo" {
3739
}
3840
```
3941

42+
### Create a listener rule for domain lists
43+
44+
```hcl
45+
resource "tencentcloud_clb_listener_rule" "example" {
46+
listener_id = "lbl-hh141sn9"
47+
clb_id = "lb-k2zjp9lv"
48+
domains = ["example1.com", "example2.com"]
49+
url = "/"
50+
health_check_switch = true
51+
health_check_interval_time = 5
52+
health_check_health_num = 3
53+
health_check_unhealth_num = 3
54+
health_check_http_code = 2
55+
health_check_http_path = "/"
56+
health_check_http_domain = "check.com"
57+
health_check_http_method = "GET"
58+
scheduler = "WRR"
59+
}
60+
```
61+
4062
## Argument Reference
4163

4264
The following arguments are supported:
4365

4466
* `clb_id` - (Required, String) ID of CLB instance.
45-
* `domain` - (Required, String) Domain name of the listener rule.
4667
* `listener_id` - (Required, String, ForceNew) ID of CLB listener.
4768
* `url` - (Required, String) Url of the listener rule.
4869
* `certificate_ca_id` - (Optional, String) ID of the client certificate. NOTES: Only supports listeners of HTTPS protocol.
4970
* `certificate_id` - (Optional, String) ID of the server certificate. NOTES: Only supports listeners of HTTPS protocol.
5071
* `certificate_ssl_mode` - (Optional, String, ForceNew) Type of certificate. Valid values: `UNIDIRECTIONAL`, `MUTUAL`. NOTES: Only supports listeners of HTTPS protocol.
72+
* `domain` - (Optional, String) Domain name of the listener rule. Single domain rules are passed to `domain`, and multi domain rules are passed to `domains`.
73+
* `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`.
5174
* `forward_type` - (Optional, String) Forwarding protocol between the CLB instance and real server. Valid values: `HTTP`, `HTTPS`, `TRPC`. The default is `HTTP`.
5275
* `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`.
5376
* `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.
@@ -78,6 +101,6 @@ In addition to all arguments above, the following attributes are exported:
78101
CLB listener rule can be imported using the id (version >= 1.47.0), e.g.
79102

80103
```
81-
$ terraform import tencentcloud_clb_listener_rule.foo lb-7a0t6zqb#lbl-hh141sn9#loc-agg236ys
104+
$ terraform import tencentcloud_clb_listener_rule.example lb-k2zjp9lv#lbl-hh141sn9#loc-agg236ys
82105
```
83106

0 commit comments

Comments
 (0)