From 322cae0de9ed9ceebebac3604be3c08e5a913d90 Mon Sep 17 00:00:00 2001 From: arunma Date: Wed, 5 Nov 2025 22:25:48 +0800 Subject: [PATCH 1/3] fix: upstream_url_rewrite_parameters support regex field --- .../teo/resource_tc_teo_l7_acc_rule_extension.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tencentcloud/services/teo/resource_tc_teo_l7_acc_rule_extension.go b/tencentcloud/services/teo/resource_tc_teo_l7_acc_rule_extension.go index 5d7ce448e0..27030c7985 100644 --- a/tencentcloud/services/teo/resource_tc_teo_l7_acc_rule_extension.go +++ b/tencentcloud/services/teo/resource_tc_teo_l7_acc_rule_extension.go @@ -334,6 +334,11 @@ func TencentTeoL7RuleBranchBasicInfo(depth int) map[string]*schema.Schema { Optional: true, 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.", }, + "regex": { + Type: schema.TypeString, + Optional: true, + 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.", + }, }, }, }, @@ -1292,6 +1297,9 @@ func resourceTencentCloudTeoL7AccRuleGetBranchs(rulesMap map[string]interface{}) if v, ok := upstreamURLRewriteParametersMap["value"].(string); ok && v != "" { upstreamURLRewriteParameters.Value = helper.String(v) } + if v, ok := upstreamURLRewriteParametersMap["regex"].(string); ok && v != "" { + upstreamURLRewriteParameters.Regex = helper.String(v) + } ruleEngineAction.UpstreamURLRewriteParameters = &upstreamURLRewriteParameters } if qUICParametersMap, ok := helper.ConvertInterfacesHeadToMap(actionsMap["quic_parameters"]); ok { @@ -1943,6 +1951,11 @@ func resourceTencentCloudTeoL7AccRuleSetBranchs(ruleBranches []*teo.RuleBranch) upstreamURLRewriteParametersMap["value"] = actions.UpstreamURLRewriteParameters.Value } + if actions.UpstreamURLRewriteParameters.Regex != nil { + upstreamURLRewriteParametersMap["regex"] = actions.UpstreamURLRewriteParameters.Regex + + } + actionsMap["upstream_url_rewrite_parameters"] = []interface{}{upstreamURLRewriteParametersMap} } From 6303f0cb4f1c3ec59cf77ea3086533aac1c68290 Mon Sep 17 00:00:00 2001 From: arunma Date: Wed, 5 Nov 2025 22:56:32 +0800 Subject: [PATCH 2/3] fix: update doc --- website/docs/r/teo_l7_acc_rule.html.markdown | 1 + website/docs/r/teo_l7_acc_rule_v2.html.markdown | 1 + 2 files changed, 2 insertions(+) diff --git a/website/docs/r/teo_l7_acc_rule.html.markdown b/website/docs/r/teo_l7_acc_rule.html.markdown index df357b2031..5ff56fbf18 100644 --- a/website/docs/r/teo_l7_acc_rule.html.markdown +++ b/website/docs/r/teo_l7_acc_rule.html.markdown @@ -714,6 +714,7 @@ The `upstream_request_parameters` object of `actions` supports the following: The `upstream_url_rewrite_parameters` object of `actions` supports the following: * `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. +* `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. * `type` - (Optional, String) Origin-Pull url rewriting type, only path is supported. * `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. diff --git a/website/docs/r/teo_l7_acc_rule_v2.html.markdown b/website/docs/r/teo_l7_acc_rule_v2.html.markdown index 4d46d0e62d..3eb49b2471 100644 --- a/website/docs/r/teo_l7_acc_rule_v2.html.markdown +++ b/website/docs/r/teo_l7_acc_rule_v2.html.markdown @@ -468,6 +468,7 @@ The `upstream_request_parameters` object of `actions` supports the following: The `upstream_url_rewrite_parameters` object of `actions` supports the following: * `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. +* `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. * `type` - (Optional, String) Origin-Pull url rewriting type, only path is supported. * `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. From 8b87c8c28e633ebaa4130db1de94aad62a908801 Mon Sep 17 00:00:00 2001 From: arunma Date: Wed, 5 Nov 2025 23:00:00 +0800 Subject: [PATCH 3/3] fix: add changelog --- .changelog/3586.txt | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changelog/3586.txt diff --git a/.changelog/3586.txt b/.changelog/3586.txt new file mode 100644 index 0000000000..172e31264e --- /dev/null +++ b/.changelog/3586.txt @@ -0,0 +1,7 @@ +```release-note:enhancement +resource/tencentcloud_teo_l7_acc_rule: upstream_url_rewrite_parameters support regex field. +``` + +```release-note:enhancement +resource/tencentcloud_teo_l7_acc_rule_v2: upstream_url_rewrite_parameters support regex field. +``` \ No newline at end of file