Skip to content

Commit 3db24a4

Browse files
committed
add
1 parent 9216eab commit 3db24a4

File tree

3 files changed

+42
-33
lines changed

3 files changed

+42
-33
lines changed

tencentcloud/services/cfs/resource_tc_cfs_auto_snapshot_policy.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ func resourceTencentCloudCfsAutoSnapshotPolicyCreate(d *schema.ResourceData, met
105105
} else {
106106
log.Printf("[DEBUG]%s api[%s] success, request body [%s], response body [%s]\n", logId, request.GetAction(), request.ToJsonString(), result.ToJsonString())
107107
}
108+
109+
if result == nil || result.Response == nil {
110+
return resource.NonRetryableError(fmt.Errorf("Create cfs autoSnapshotPolicy failed, Response is nil."))
111+
}
112+
108113
response = result
109114
return nil
110115
})
@@ -113,6 +118,10 @@ func resourceTencentCloudCfsAutoSnapshotPolicyCreate(d *schema.ResourceData, met
113118
return err
114119
}
115120

121+
if response.Response.AutoSnapshotPolicyId == nil {
122+
return fmt.Errorf("AutoSnapshotPolicyId is nil.")
123+
}
124+
116125
autoSnapshotPolicyId = *response.Response.AutoSnapshotPolicyId
117126
d.SetId(autoSnapshotPolicyId)
118127

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
1-
Provides a resource to create a cfs auto_snapshot_policy
1+
Provides a resource to create a cfs auto snapshot policy
22

33
Example Usage
44

5-
use day of week
5+
Use day of week
66

77
```hcl
8-
resource "tencentcloud_cfs_auto_snapshot_policy" "auto_snapshot_policy" {
8+
resource "tencentcloud_cfs_auto_snapshot_policy" "example" {
9+
policy_name = "tf-example"
910
day_of_week = "1,2"
10-
hour = "2,3"
11-
policy_name = "policy_name"
12-
alive_days = 7
11+
hour = "2,3"
12+
alive_days = 7
1313
}
1414
```
1515

16-
use day of month
16+
Use day of month
1717

1818
```hcl
19-
resource "tencentcloud_cfs_auto_snapshot_policy" "auto_snapshot_policy" {
20-
hour = "2,3"
21-
policy_name = "policy_name"
22-
alive_days = 7
19+
resource "tencentcloud_cfs_auto_snapshot_policy" "example" {
20+
policy_name = "tf-example"
2321
day_of_month = "2,3,4"
22+
hour = "2,3"
23+
alive_days = 7
2424
}
2525
```
2626

27-
use interval days
27+
Use interval days
2828

2929
```hcl
30-
resource "tencentcloud_cfs_auto_snapshot_policy" "auto_snapshot_policy" {
31-
hour = "2,3"
32-
policy_name = "policy_name"
33-
alive_days = 7
30+
resource "tencentcloud_cfs_auto_snapshot_policy" "example" {
31+
policy_name = "policy_name"
3432
interval_days = 1
33+
hour = "2,3"
34+
alive_days = 7
3535
}
3636
```
3737

3838
Import
3939

40-
cfs auto_snapshot_policy can be imported using the id, e.g.
40+
cfs auto snapshot policy can be imported using the id, e.g.
4141

4242
```
43-
terraform import tencentcloud_cfs_auto_snapshot_policy.auto_snapshot_policy auto_snapshot_policy_id
43+
terraform import tencentcloud_cfs_auto_snapshot_policy.example asp-f8q793kj
4444
```

website/docs/r/cfs_auto_snapshot_policy.html.markdown

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,45 @@ layout: "tencentcloud"
44
page_title: "TencentCloud: tencentcloud_cfs_auto_snapshot_policy"
55
sidebar_current: "docs-tencentcloud-resource-cfs_auto_snapshot_policy"
66
description: |-
7-
Provides a resource to create a cfs auto_snapshot_policy
7+
Provides a resource to create a cfs auto snapshot policy
88
---
99

1010
# tencentcloud_cfs_auto_snapshot_policy
1111

12-
Provides a resource to create a cfs auto_snapshot_policy
12+
Provides a resource to create a cfs auto snapshot policy
1313

1414
## Example Usage
1515

16-
### use day of week
16+
### Use day of week
1717

1818
```hcl
19-
resource "tencentcloud_cfs_auto_snapshot_policy" "auto_snapshot_policy" {
19+
resource "tencentcloud_cfs_auto_snapshot_policy" "example" {
20+
policy_name = "tf-example"
2021
day_of_week = "1,2"
2122
hour = "2,3"
22-
policy_name = "policy_name"
2323
alive_days = 7
2424
}
2525
```
2626

27-
### use day of month
27+
### Use day of month
2828

2929
```hcl
30-
resource "tencentcloud_cfs_auto_snapshot_policy" "auto_snapshot_policy" {
30+
resource "tencentcloud_cfs_auto_snapshot_policy" "example" {
31+
policy_name = "tf-example"
32+
day_of_month = "2,3,4"
3133
hour = "2,3"
32-
policy_name = "policy_name"
3334
alive_days = 7
34-
day_of_month = "2,3,4"
3535
}
3636
```
3737

38-
### use interval days
38+
### Use interval days
3939

4040
```hcl
41-
resource "tencentcloud_cfs_auto_snapshot_policy" "auto_snapshot_policy" {
42-
hour = "2,3"
41+
resource "tencentcloud_cfs_auto_snapshot_policy" "example" {
4342
policy_name = "policy_name"
44-
alive_days = 7
4543
interval_days = 1
44+
hour = "2,3"
45+
alive_days = 7
4646
}
4747
```
4848

@@ -67,9 +67,9 @@ In addition to all arguments above, the following attributes are exported:
6767

6868
## Import
6969

70-
cfs auto_snapshot_policy can be imported using the id, e.g.
70+
cfs auto snapshot policy can be imported using the id, e.g.
7171

7272
```
73-
terraform import tencentcloud_cfs_auto_snapshot_policy.auto_snapshot_policy auto_snapshot_policy_id
73+
terraform import tencentcloud_cfs_auto_snapshot_policy.example asp-f8q793kj
7474
```
7575

0 commit comments

Comments
 (0)