Skip to content

Commit d1c25a3

Browse files
author
mikatong
committed
update
1 parent a87e128 commit d1c25a3

File tree

4 files changed

+30
-30
lines changed

4 files changed

+30
-30
lines changed

.changelog/2978.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
```release-note:enhancement
2-
resource/tencentcloud_clb_listener_rule: support param `o_auth`
2+
resource/tencentcloud_clb_listener_rule: support param `oauth`
33
```

tencentcloud/services/clb/resource_tc_clb_listener_rule.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -185,21 +185,21 @@ func ResourceTencentCloudClbListenerRule() *schema.Resource {
185185
Computed: true,
186186
Description: "Whether to enable QUIC. Note: QUIC can be enabled only for HTTPS domain names.",
187187
},
188-
"o_auth": {
188+
"oauth": {
189189
Type: schema.TypeList,
190190
Optional: true,
191191
Computed: true,
192192
MaxItems: 1,
193193
Description: "OAuth configuration information.",
194194
Elem: &schema.Resource{
195195
Schema: map[string]*schema.Schema{
196-
"o_auth_enable": {
196+
"oauth_enable": {
197197
Type: schema.TypeBool,
198198
Optional: true,
199199
Computed: true,
200200
Description: "Enable or disable authentication. True: Enabled; False: Disabled.",
201201
},
202-
"o_auth_failure_status": {
202+
"oauth_failure_status": {
203203
Type: schema.TypeString,
204204
Optional: true,
205205
Computed: true,
@@ -408,16 +408,16 @@ func resourceTencentCloudClbListenerRuleCreate(d *schema.ResourceData, meta inte
408408
}
409409
}
410410

411-
if dMap, ok := helper.InterfacesHeadMap(d, "o_auth"); ok {
411+
if dMap, ok := helper.InterfacesHeadMap(d, "oauth"); ok {
412412
modifyRuleRequest := clb.NewModifyRuleRequest()
413413
modifyRuleRequest.ListenerId = helper.String(listenerId)
414414
modifyRuleRequest.LoadBalancerId = helper.String(clbId)
415415
modifyRuleRequest.LocationId = helper.String(locationId)
416416
oauth := &clb.OAuth{}
417-
if v, ok := dMap["o_auth_enable"]; ok {
417+
if v, ok := dMap["oauth_enable"]; ok {
418418
oauth.OAuthEnable = helper.Bool(v.(bool))
419419
}
420-
if v, ok := dMap["o_auth_failure_status"]; ok {
420+
if v, ok := dMap["oauth_failure_status"]; ok {
421421
oauth.OAuthFailureStatus = helper.String(v.(string))
422422
}
423423
modifyRuleRequest.OAuth = oauth
@@ -554,12 +554,12 @@ func resourceTencentCloudClbListenerRuleRead(d *schema.ResourceData, meta interf
554554
if instance.OAuth != nil {
555555
oath := make(map[string]interface{})
556556
if instance.OAuth.OAuthEnable != nil {
557-
oath["o_auth_enable"] = instance.OAuth.OAuthEnable
557+
oath["oauth_enable"] = instance.OAuth.OAuthEnable
558558
}
559559
if instance.OAuth.OAuthFailureStatus != nil {
560-
oath["o_auth_failure_status"] = instance.OAuth.OAuthFailureStatus
560+
oath["oauth_failure_status"] = instance.OAuth.OAuthFailureStatus
561561
}
562-
_ = d.Set("o_auth", []interface{}{oath})
562+
_ = d.Set("oauth", []interface{}{oath})
563563
}
564564

565565
return nil
@@ -615,14 +615,14 @@ func resourceTencentCloudClbListenerRuleUpdate(d *schema.ResourceData, meta inte
615615
url = d.Get("url").(string)
616616
request.Url = helper.String(url)
617617
}
618-
if d.HasChange("o_auth") {
618+
if d.HasChange("oauth") {
619619
changed = true
620-
if dMap, ok := helper.InterfacesHeadMap(d, "o_auth"); ok {
620+
if dMap, ok := helper.InterfacesHeadMap(d, "oauth"); ok {
621621
oauth := &clb.OAuth{}
622-
if v, ok := dMap["o_auth_enable"]; ok {
622+
if v, ok := dMap["oauth_enable"]; ok {
623623
oauth.OAuthEnable = helper.Bool(v.(bool))
624624
}
625-
if v, ok := dMap["o_auth_failure_status"]; ok {
625+
if v, ok := dMap["oauth_failure_status"]; ok {
626626
oauth.OAuthFailureStatus = helper.String(v.(string))
627627
}
628628
request.OAuth = oauth

tencentcloud/services/clb/resource_tc_clb_listener_rule_test.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -133,18 +133,18 @@ func TestAccTencentCloudClbListenerRuleResource_oauth(t *testing.T) {
133133
Config: testAccClbListenerRule_oauth,
134134
Check: resource.ComposeTestCheckFunc(
135135
testAccCheckClbListenerRuleExists("tencentcloud_clb_listener_rule.rule_oauth"),
136-
resource.TestCheckResourceAttr("tencentcloud_clb_listener_rule.rule_oauth", "o_auth.#", "1"),
137-
resource.TestCheckResourceAttr("tencentcloud_clb_listener_rule.rule_oauth", "o_auth.0.o_auth_enable", "true"),
138-
resource.TestCheckResourceAttr("tencentcloud_clb_listener_rule.rule_oauth", "o_auth.0.o_auth_failure_status", "REJECT"),
136+
resource.TestCheckResourceAttr("tencentcloud_clb_listener_rule.rule_oauth", "oauth.#", "1"),
137+
resource.TestCheckResourceAttr("tencentcloud_clb_listener_rule.rule_oauth", "oauth.0.oauth_enable", "true"),
138+
resource.TestCheckResourceAttr("tencentcloud_clb_listener_rule.rule_oauth", "oauth.0.oauth_failure_status", "REJECT"),
139139
),
140140
},
141141
{
142142
Config: testAccClbListenerRule_oauthUpdate,
143143
Check: resource.ComposeTestCheckFunc(
144144
testAccCheckClbListenerRuleExists("tencentcloud_clb_listener_rule.rule_oauth"),
145-
resource.TestCheckResourceAttr("tencentcloud_clb_listener_rule.rule_oauth", "o_auth.#", "1"),
146-
resource.TestCheckResourceAttr("tencentcloud_clb_listener_rule.rule_oauth", "o_auth.0.o_auth_enable", "false"),
147-
resource.TestCheckResourceAttr("tencentcloud_clb_listener_rule.rule_oauth", "o_auth.0.o_auth_failure_status", "BYPASS"),
145+
resource.TestCheckResourceAttr("tencentcloud_clb_listener_rule.rule_oauth", "oauth.#", "1"),
146+
resource.TestCheckResourceAttr("tencentcloud_clb_listener_rule.rule_oauth", "oauth.0.oauth_enable", "false"),
147+
resource.TestCheckResourceAttr("tencentcloud_clb_listener_rule.rule_oauth", "oauth.0.oauth_failure_status", "BYPASS"),
148148
),
149149
},
150150
{
@@ -345,9 +345,9 @@ resource "tencentcloud_clb_listener_rule" "rule_oauth" {
345345
scheduler = "WRR"
346346
target_type = "TARGETGROUP"
347347
forward_type = "HTTPS"
348-
o_auth {
349-
o_auth_enable = true
350-
o_auth_failure_status = "REJECT"
348+
oauth {
349+
oauth_enable = true
350+
oauth_failure_status = "REJECT"
351351
}
352352
}
353353
`
@@ -362,9 +362,9 @@ resource "tencentcloud_clb_listener_rule" "rule_oauth" {
362362
scheduler = "WRR"
363363
target_type = "TARGETGROUP"
364364
forward_type = "HTTPS"
365-
o_auth {
366-
o_auth_enable = false
367-
o_auth_failure_status = "BYPASS"
365+
oauth {
366+
oauth_enable = false
367+
oauth_failure_status = "BYPASS"
368368
}
369369
}
370370
`

website/docs/r/clb_listener_rule.html.markdown

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,16 @@ The following arguments are supported:
8383
* `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.
86-
* `o_auth` - (Optional, List) OAuth configuration information.
86+
* `oauth` - (Optional, List) OAuth configuration information.
8787
* `quic` - (Optional, Bool) Whether to enable QUIC. Note: QUIC can be enabled only for HTTPS domain names.
8888
* `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`.
8989
* `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`.
9090
* `target_type` - (Optional, String, ForceNew) Backend target type. Valid values: `NODE`, `TARGETGROUP`. `NODE` means to bind ordinary nodes, `TARGETGROUP` means to bind target group.
9191

92-
The `o_auth` object supports the following:
92+
The `oauth` object supports the following:
9393

94-
* `o_auth_enable` - (Optional, Bool) Enable or disable authentication. True: Enabled; False: Disabled.
95-
* `o_auth_failure_status` - (Optional, String) After all IAPs fail, the request is rejected or released. BYPASS: PASS; REJECT: Reject.
94+
* `oauth_enable` - (Optional, Bool) Enable or disable authentication. True: Enabled; False: Disabled.
95+
* `oauth_failure_status` - (Optional, String) After all IAPs fail, the request is rejected or released. BYPASS: PASS; REJECT: Reject.
9696

9797
## Attributes Reference
9898

0 commit comments

Comments
 (0)