Skip to content

Commit 6d8e503

Browse files
committed
feat(tcr): [111111111] adjust modify logic
1 parent a9a3ce5 commit 6d8e503

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

tencentcloud/services/tcr/resource_tc_tcr_tag_retention_rule.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ func ResourceTencentCloudTcrTagRetentionRule() *schema.Resource {
6666

6767
"cron_setting": {
6868
Required: true,
69+
ForceNew: true,
6970
Type: schema.TypeString,
7071
Description: "Execution cycle, currently only available selections are: manual; daily; weekly; monthly.",
7172
},
@@ -267,7 +268,7 @@ func resourceTencentCloudTcrTagRetentionRuleUpdate(d *schema.ResourceData, meta
267268
}
268269
}
269270

270-
if d.HasChange("retention_rule") {
271+
if d.HasChange("retention_rule") || d.HasChange("disabled") {
271272
if dMap, ok := helper.InterfacesHeadMap(d, "retention_rule"); ok {
272273
retentionRule := tcr.RetentionRule{}
273274
if v, ok := dMap["key"]; ok {
@@ -278,9 +279,7 @@ func resourceTencentCloudTcrTagRetentionRuleUpdate(d *schema.ResourceData, meta
278279
}
279280
request.RetentionRule = &retentionRule
280281
}
281-
}
282282

283-
if d.HasChange("disabled") {
284283
if v, ok := d.GetOkExists("disabled"); ok {
285284
request.Disabled = helper.Bool(v.(bool))
286285
}

tencentcloud/services/tcr/resource_tc_tcr_tag_retention_rule.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Provides a resource to create a tcr tag retention rule.
22

33
Example Usage
44

5-
Create a tcr tag retention rule instance
5+
Create and enable a tcr tag retention rule instance
66

77
```hcl
88
resource "tencentcloud_tcr_instance" "example" {
@@ -34,6 +34,5 @@ resource "tencentcloud_tcr_tag_retention_rule" "my_rule" {
3434
value = 2
3535
}
3636
cron_setting = "daily"
37-
disabled = true
3837
}
3938
```

website/docs/r/tcr_tag_retention_rule.html.markdown

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Provides a resource to create a tcr tag retention rule.
1313

1414
## Example Usage
1515

16-
### Create a tcr tag retention rule instance
16+
### Create and enable a tcr tag retention rule instance
1717

1818
```hcl
1919
resource "tencentcloud_tcr_instance" "example" {
@@ -45,15 +45,14 @@ resource "tencentcloud_tcr_tag_retention_rule" "my_rule" {
4545
value = 2
4646
}
4747
cron_setting = "daily"
48-
disabled = true
4948
}
5049
```
5150

5251
## Argument Reference
5352

5453
The following arguments are supported:
5554

56-
* `cron_setting` - (Required, String) Execution cycle, currently only available selections are: manual; daily; weekly; monthly.
55+
* `cron_setting` - (Required, String, ForceNew) Execution cycle, currently only available selections are: manual; daily; weekly; monthly.
5756
* `namespace_name` - (Required, String) The Name of the namespace.
5857
* `registry_id` - (Required, String) The main instance ID.
5958
* `retention_rule` - (Required, List) Retention Policy.

0 commit comments

Comments
 (0)