Skip to content

Commit 599d371

Browse files
committed
update cfs snapshot policy
1 parent b051d02 commit 599d371

File tree

3 files changed

+59
-7
lines changed

3 files changed

+59
-7
lines changed

.changelog/1631.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:new-resource
2+
resource/tencentcloud_cfs_auto_snapshot_policy: support set day_of_month and interval_days
3+
```

tencentcloud/resource_tc_cfs_auto_snapshot_policy.go

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ Provides a resource to create a cfs auto_snapshot_policy
33
44
Example Usage
55
6+
use day of week
7+
68
```hcl
79
resource "tencentcloud_cfs_auto_snapshot_policy" "auto_snapshot_policy" {
810
day_of_week = "1,2"
@@ -12,6 +14,29 @@ resource "tencentcloud_cfs_auto_snapshot_policy" "auto_snapshot_policy" {
1214
}
1315
```
1416
17+
use day of month
18+
19+
```hcl
20+
resource "tencentcloud_cfs_auto_snapshot_policy" "auto_snapshot_policy" {
21+
hour = "2,3"
22+
policy_name = "policy_name"
23+
alive_days = 7
24+
day_of_month = "2,3,4"
25+
}
26+
```
27+
28+
use interval days
29+
30+
```hcl
31+
resource "tencentcloud_cfs_auto_snapshot_policy" "auto_snapshot_policy" {
32+
hour = "2,3"
33+
policy_name = "policy_name"
34+
alive_days = 7
35+
interval_days = 1
36+
}
37+
```
38+
39+
1540
Import
1641
1742
cfs auto_snapshot_policy can be imported using the id, e.g.
@@ -43,12 +68,6 @@ func resourceTencentCloudCfsAutoSnapshotPolicy() *schema.Resource {
4368
State: schema.ImportStatePassthrough,
4469
},
4570
Schema: map[string]*schema.Schema{
46-
"day_of_week": {
47-
Required: true,
48-
Type: schema.TypeString,
49-
Description: "The day of the week on which to repeat the snapshot operation.",
50-
},
51-
5271
"hour": {
5372
Required: true,
5473
Type: schema.TypeString,
@@ -61,6 +80,12 @@ func resourceTencentCloudCfsAutoSnapshotPolicy() *schema.Resource {
6180
Description: "Policy name.",
6281
},
6382

83+
"day_of_week": {
84+
Optional: true,
85+
Type: schema.TypeString,
86+
Description: "The day of the week on which to repeat the snapshot operation.",
87+
},
88+
6489
"alive_days": {
6590
Optional: true,
6691
Type: schema.TypeInt,

website/docs/r/cfs_auto_snapshot_policy.html.markdown

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Provides a resource to create a cfs auto_snapshot_policy
1313

1414
## Example Usage
1515

16+
use day of week
17+
1618
```hcl
1719
resource "tencentcloud_cfs_auto_snapshot_policy" "auto_snapshot_policy" {
1820
day_of_week = "1,2"
@@ -22,14 +24,36 @@ resource "tencentcloud_cfs_auto_snapshot_policy" "auto_snapshot_policy" {
2224
}
2325
```
2426

27+
use day of month
28+
29+
```hcl
30+
resource "tencentcloud_cfs_auto_snapshot_policy" "auto_snapshot_policy" {
31+
hour = "2,3"
32+
policy_name = "policy_name"
33+
alive_days = 7
34+
day_of_month = "2,3,4"
35+
}
36+
```
37+
38+
use interval days
39+
40+
```hcl
41+
resource "tencentcloud_cfs_auto_snapshot_policy" "auto_snapshot_policy" {
42+
hour = "2,3"
43+
policy_name = "policy_name"
44+
alive_days = 7
45+
interval_days = 1
46+
}
47+
```
48+
2549
## Argument Reference
2650

2751
The following arguments are supported:
2852

29-
* `day_of_week` - (Required, String) The day of the week on which to repeat the snapshot operation.
3053
* `hour` - (Required, String) The time point when to repeat the snapshot operation.
3154
* `alive_days` - (Optional, Int) Snapshot retention period.
3255
* `day_of_month` - (Optional, String) The specific day (day 1 to day 31) of the month on which to create a snapshot.
56+
* `day_of_week` - (Optional, String) The day of the week on which to repeat the snapshot operation.
3357
* `interval_days` - (Optional, Int) The snapshot interval, in days.
3458
* `policy_name` - (Optional, String) Policy name.
3559

0 commit comments

Comments
 (0)