Skip to content

Commit ae7dbb3

Browse files
authored
Merge pull request #1554 from tencentcloudstack/feat/set_weight_default
set weight default 10
2 parents 944510f + 9710351 commit ae7dbb3

File tree

5 files changed

+10
-3
lines changed

5 files changed

+10
-3
lines changed

.changelog/1554.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
resource/tencentcloud_clb_function_targets_attachment: set weight default `10`.
3+
```

tencentcloud/resource_tc_clb_function_targets_attachment.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,9 @@ func resourceTencentCloudClbFunctionTargetsAttachment() *schema.Resource {
109109
},
110110
"weight": {
111111
Type: schema.TypeInt,
112+
Default: 10,
112113
Optional: true,
113-
Description: "Weight.",
114+
Description: "Weight. The default is `10`.",
114115
},
115116
},
116117
},

tencentcloud/resource_tc_clb_function_targets_attachment_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ resource "tencentcloud_clb_function_targets_attachment" "function_targets" {
3939
weight = 10
4040
4141
function {
42-
function_name = "keep-tf-test-1675954233"
42+
function_name = "keep-1676351130"
4343
function_namespace = "default"
4444
function_qualifier = "$LATEST"
4545
function_qualifier_type = "VERSION"

tencentcloud/resource_tc_scf_function_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ func init() {
4444
createTime := stringTotime(*fun.AddTime)
4545
now := time.Now()
4646
interval := now.Sub(createTime).Minutes()
47+
if strings.HasPrefix(*fun.FunctionName, keepResource) || strings.HasPrefix(*fun.FunctionName, defaultResource) {
48+
continue
49+
}
4750
// less than 30 minute, not delete
4851
if needProtect == 1 && int64(interval) < 30 {
4952
continue

website/docs/r/clb_function_targets_attachment.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ The following arguments are supported:
4747
The `function_targets` object supports the following:
4848

4949
* `function` - (Required, List) Information about cloud functions.&quot;Note: This field may return null, indicating that no valid value can be obtained.
50-
* `weight` - (Optional, Int) Weight.
50+
* `weight` - (Optional, Int) Weight. The default is `10`.
5151

5252
The `function` object supports the following:
5353

0 commit comments

Comments
 (0)