Skip to content

Commit b7e58d4

Browse files
authored
fix: [128294325] upstream_url_rewrite_parameters support regex field (#3586)
* fix: upstream_url_rewrite_parameters support regex field * fix: update doc * fix: add changelog
1 parent 175ed7b commit b7e58d4

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

.changelog/3586.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
```release-note:enhancement
2+
resource/tencentcloud_teo_l7_acc_rule: upstream_url_rewrite_parameters support regex field.
3+
```
4+
5+
```release-note:enhancement
6+
resource/tencentcloud_teo_l7_acc_rule_v2: upstream_url_rewrite_parameters support regex field.
7+
```

tencentcloud/services/teo/resource_tc_teo_l7_acc_rule_extension.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,11 @@ func TencentTeoL7RuleBranchBasicInfo(depth int) map[string]*schema.Schema {
334334
Optional: true,
335335
Description: "Origin-Pull url rewrite value, maximum length 1024, must start with /.note: when action is addprefix, it cannot end with /; when action is rmvprefix, * cannot be present.",
336336
},
337+
"regex": {
338+
Type: schema.TypeString,
339+
Optional: true,
340+
Description: "Origin URL Rewrite uses a regular expression for matching the complete path. It must conform to the Google RE2 specification and have a length range of 1 to 1024. This field is required when the Action is regexReplace; otherwise, it is optional.",
341+
},
337342
},
338343
},
339344
},
@@ -1292,6 +1297,9 @@ func resourceTencentCloudTeoL7AccRuleGetBranchs(rulesMap map[string]interface{})
12921297
if v, ok := upstreamURLRewriteParametersMap["value"].(string); ok && v != "" {
12931298
upstreamURLRewriteParameters.Value = helper.String(v)
12941299
}
1300+
if v, ok := upstreamURLRewriteParametersMap["regex"].(string); ok && v != "" {
1301+
upstreamURLRewriteParameters.Regex = helper.String(v)
1302+
}
12951303
ruleEngineAction.UpstreamURLRewriteParameters = &upstreamURLRewriteParameters
12961304
}
12971305
if qUICParametersMap, ok := helper.ConvertInterfacesHeadToMap(actionsMap["quic_parameters"]); ok {
@@ -1943,6 +1951,11 @@ func resourceTencentCloudTeoL7AccRuleSetBranchs(ruleBranches []*teo.RuleBranch)
19431951
upstreamURLRewriteParametersMap["value"] = actions.UpstreamURLRewriteParameters.Value
19441952
}
19451953

1954+
if actions.UpstreamURLRewriteParameters.Regex != nil {
1955+
upstreamURLRewriteParametersMap["regex"] = actions.UpstreamURLRewriteParameters.Regex
1956+
1957+
}
1958+
19461959
actionsMap["upstream_url_rewrite_parameters"] = []interface{}{upstreamURLRewriteParametersMap}
19471960
}
19481961

website/docs/r/teo_l7_acc_rule.html.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,7 @@ The `upstream_request_parameters` object of `actions` supports the following:
714714
The `upstream_url_rewrite_parameters` object of `actions` supports the following:
715715

716716
* `action` - (Optional, String) Origin-Pull url rewrite action. valid values are: replace: replace the path prefix; addPrefix: add the path prefix; rmvPrefix: remove the path prefix.
717+
* `regex` - (Optional, String) Origin URL Rewrite uses a regular expression for matching the complete path. It must conform to the Google RE2 specification and have a length range of 1 to 1024. This field is required when the Action is regexReplace; otherwise, it is optional.
717718
* `type` - (Optional, String) Origin-Pull url rewriting type, only path is supported.
718719
* `value` - (Optional, String) Origin-Pull url rewrite value, maximum length 1024, must start with /.note: when action is addprefix, it cannot end with /; when action is rmvprefix, * cannot be present.
719720

website/docs/r/teo_l7_acc_rule_v2.html.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,7 @@ The `upstream_request_parameters` object of `actions` supports the following:
468468
The `upstream_url_rewrite_parameters` object of `actions` supports the following:
469469

470470
* `action` - (Optional, String) Origin-Pull url rewrite action. valid values are: replace: replace the path prefix; addPrefix: add the path prefix; rmvPrefix: remove the path prefix.
471+
* `regex` - (Optional, String) Origin URL Rewrite uses a regular expression for matching the complete path. It must conform to the Google RE2 specification and have a length range of 1 to 1024. This field is required when the Action is regexReplace; otherwise, it is optional.
471472
* `type` - (Optional, String) Origin-Pull url rewriting type, only path is supported.
472473
* `value` - (Optional, String) Origin-Pull url rewrite value, maximum length 1024, must start with /.note: when action is addprefix, it cannot end with /; when action is rmvprefix, * cannot be present.
473474

0 commit comments

Comments
 (0)