Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changelog/3586.txt
Original file line number Diff line number Diff line change
@@ -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.
```
13 changes: 13 additions & 0 deletions tencentcloud/services/teo/resource_tc_teo_l7_acc_rule_extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
},
},
},
},
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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}
}

Expand Down
1 change: 1 addition & 0 deletions website/docs/r/teo_l7_acc_rule.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
1 change: 1 addition & 0 deletions website/docs/r/teo_l7_acc_rule_v2.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Loading