Skip to content

Commit b66c60b

Browse files
committed
add
1 parent 0aebdf8 commit b66c60b

File tree

2 files changed

+21
-9
lines changed

2 files changed

+21
-9
lines changed

tencentcloud/services/clb/resource_tc_clb_listener_rule.go

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,21 +144,18 @@ func ResourceTencentCloudClbListenerRule() *schema.Resource {
144144
"certificate_id": {
145145
Type: schema.TypeString,
146146
Optional: true,
147-
ForceNew: true,
148147
ConflictsWith: []string{"multi_cert_info"},
149148
Description: "ID of the server certificate. NOTES: Only supports listeners of HTTPS protocol.",
150149
},
151150
"certificate_ca_id": {
152151
Type: schema.TypeString,
153152
Optional: true,
154-
ForceNew: true,
155153
ConflictsWith: []string{"multi_cert_info"},
156154
Description: "ID of the client certificate. NOTES: Only supports listeners of HTTPS protocol.",
157155
},
158156
"multi_cert_info": {
159157
Type: schema.TypeList,
160158
Optional: true,
161-
ForceNew: true,
162159
MaxItems: 1,
163160
ConflictsWith: []string{"certificate_ssl_mode", "certificate_id", "certificate_ca_id"},
164161
Description: "Certificate information. You can specify multiple server-side certificates with different algorithm types. This parameter is only applicable to HTTPS listeners with the SNI feature not enabled. Certificate and MultiCertInfo cannot be specified at the same time.",
@@ -174,7 +171,6 @@ func ResourceTencentCloudClbListenerRule() *schema.Resource {
174171
"cert_id_list": {
175172
Type: schema.TypeSet,
176173
Required: true,
177-
ForceNew: true,
178174
Description: "List of server certificate ID.",
179175
Elem: &schema.Schema{Type: schema.TypeString},
180176
},
@@ -372,7 +368,7 @@ func resourceTencentCloudClbListenerRuleCreate(d *schema.ResourceData, meta inte
372368
rule.MultiCertInfo = multiCertInput
373369
} else {
374370
if protocol == CLB_LISTENER_PROTOCOL_TCPSSL {
375-
return fmt.Errorf("[CHECK][CLB listener][Create] check: certificated need to be set when protocol is TCPSSL")
371+
return fmt.Errorf("[CHECK][CLB listener][Create] check: certificated need to be set when protocol is HTTPS")
376372
}
377373
}
378374

@@ -834,6 +830,22 @@ func resourceTencentCloudClbListenerRuleUpdate(d *schema.ResourceData, meta inte
834830
}
835831
}
836832

833+
if d.HasChange("multi_cert_info") {
834+
domainChanged = true
835+
multiCertificateSetFlag, multiCertInput, certErr := checkMultiCertificateInputPara(ctx, d, meta)
836+
if certErr != nil {
837+
return certErr
838+
}
839+
840+
if multiCertificateSetFlag {
841+
domainRequest.MultiCertInfo = multiCertInput
842+
} else {
843+
if protocol == CLB_LISTENER_PROTOCOL_TCPSSL {
844+
return fmt.Errorf("[CHECK][CLB listener][Create] check: certificated need to be set when protocol is HTTPS")
845+
}
846+
}
847+
}
848+
837849
if d.HasChange("http2_switch") {
838850
if v, ok := d.GetOkExists("http2_switch"); ok {
839851
if !(protocol == CLB_LISTENER_PROTOCOL_HTTPS) {

website/docs/r/clb_listener_rule.html.markdown

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ The following arguments are supported:
7676
* `clb_id` - (Required, String) ID of CLB instance.
7777
* `listener_id` - (Required, String, ForceNew) ID of CLB listener.
7878
* `url` - (Required, String) Url of the listener rule.
79-
* `certificate_ca_id` - (Optional, String, ForceNew) ID of the client certificate. NOTES: Only supports listeners of HTTPS protocol.
80-
* `certificate_id` - (Optional, String, ForceNew) ID of the server certificate. NOTES: Only supports listeners of HTTPS protocol.
79+
* `certificate_ca_id` - (Optional, String) ID of the client certificate. NOTES: Only supports listeners of HTTPS protocol.
80+
* `certificate_id` - (Optional, String) ID of the server certificate. NOTES: Only supports listeners of HTTPS protocol.
8181
* `certificate_ssl_mode` - (Optional, String, ForceNew) Type of certificate. Valid values: `UNIDIRECTIONAL`, `MUTUAL`. NOTES: Only supports listeners of HTTPS protocol.
8282
* `domain` - (Optional, String) Domain name of the listener rule. Single domain rules are passed to `domain`, and multi domain rules are passed to `domains`.
8383
* `domains` - (Optional, Set: [`String`]) Domain name list of the listener rule. Single domain rules are passed to `domain`, and multi domain rules are passed to `domains`.
@@ -94,7 +94,7 @@ The following arguments are supported:
9494
* `health_check_type` - (Optional, String) Type of health check. Valid value is `CUSTOM`, `PING`, `TCP`, `HTTP`, `HTTPS`, `GRPC`, `GRPCS`.
9595
* `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`.
9696
* `http2_switch` - (Optional, Bool) Indicate to apply HTTP2.0 protocol or not.
97-
* `multi_cert_info` - (Optional, List, ForceNew) Certificate information. You can specify multiple server-side certificates with different algorithm types. This parameter is only applicable to HTTPS listeners with the SNI feature not enabled. Certificate and MultiCertInfo cannot be specified at the same time.
97+
* `multi_cert_info` - (Optional, List) Certificate information. You can specify multiple server-side certificates with different algorithm types. This parameter is only applicable to HTTPS listeners with the SNI feature not enabled. Certificate and MultiCertInfo cannot be specified at the same time.
9898
* `oauth` - (Optional, List) OAuth configuration information.
9999
* `quic` - (Optional, Bool) Whether to enable QUIC. Note: QUIC can be enabled only for HTTPS domain names.
100100
* `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`.
@@ -103,7 +103,7 @@ The following arguments are supported:
103103

104104
The `multi_cert_info` object supports the following:
105105

106-
* `cert_id_list` - (Required, Set, ForceNew) List of server certificate ID.
106+
* `cert_id_list` - (Required, Set) List of server certificate ID.
107107
* `ssl_mode` - (Required, String, ForceNew) Authentication type. Values: UNIDIRECTIONAL (one-way authentication), MUTUAL (two-way authentication).
108108

109109
The `oauth` object supports the following:

0 commit comments

Comments
 (0)