Skip to content

Commit 787a7dd

Browse files
authored
fix(cbs): [137144765] tencentcloud_cbs_disk_backup update resource creation error message (#3129)
* add * add
1 parent 0b7d2ca commit 787a7dd

File tree

4 files changed

+48
-19
lines changed

4 files changed

+48
-19
lines changed

.changelog/3129.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_cbs_disk_backup: update resource creation error message
3+
```

tencentcloud/services/cbs/resource_tc_cbs_disk_backup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func resourceTencentCloudCbsDiskBackupCreate(d *schema.ResourceData, meta interf
6060
service := CbsService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()}
6161
diskBackupId, err := service.CreateDiskBackup(ctx, diskId, diskBackupName)
6262
if err != nil {
63-
return nil
63+
return err
6464
}
6565
d.SetId(diskBackupId)
6666
err = resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError {
Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,34 @@
1-
Provides a resource to create a cbs disk_backup.
1+
Provides a resource to create a CBS disk backup.
22

3-
~> **NOTE:** Backup quota must greater than 1.
3+
~> **NOTE:** The parameter `disk_backup_quota` in the resource `tencentcloud_cbs_storage` must be greater than 1.
44

55
Example Usage
66

77
```hcl
8-
9-
resource "tencentcloud_cbs_disk_backup" "disk_backup" {
10-
disk_id = "disk-xxx"
11-
disk_backup_name = "xxx"
12-
}
13-
8+
resource "tencentcloud_cbs_storage" "example" {
9+
storage_name = "tf-example"
10+
storage_type = "CLOUD_SSD"
11+
storage_size = 100
12+
availability_zone = "ap-guangzhou-6"
13+
project_id = 0
14+
encrypt = false
15+
disk_backup_quota = 3
16+
17+
tags = {
18+
createBy = "Terraform"
19+
}
20+
}
21+
22+
resource "tencentcloud_cbs_disk_backup" "example" {
23+
disk_id = tencentcloud_cbs_storage.example.id
24+
disk_backup_name = "tf-example"
25+
}
1426
```
1527

1628
Import
1729

18-
cbs disk_backup can be imported using the id, e.g.
30+
CBS disk backup can be imported using the id, e.g.
1931

2032
```
21-
terraform import tencentcloud_cbs_disk_backup.disk_backup disk_backup_id
33+
terraform import tencentcloud_cbs_disk_backup.example dbp-qax6zwvr
2234
```

website/docs/r/cbs_disk_backup.html.markdown

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,35 @@ layout: "tencentcloud"
44
page_title: "TencentCloud: tencentcloud_cbs_disk_backup"
55
sidebar_current: "docs-tencentcloud-resource-cbs_disk_backup"
66
description: |-
7-
Provides a resource to create a cbs disk_backup.
7+
Provides a resource to create a CBS disk backup.
88
---
99

1010
# tencentcloud_cbs_disk_backup
1111

12-
Provides a resource to create a cbs disk_backup.
12+
Provides a resource to create a CBS disk backup.
1313

14-
~> **NOTE:** Backup quota must greater than 1.
14+
~> **NOTE:** The parameter `disk_backup_quota` in the resource `tencentcloud_cbs_storage` must be greater than 1.
1515

1616
## Example Usage
1717

1818
```hcl
19-
resource "tencentcloud_cbs_disk_backup" "disk_backup" {
20-
disk_id = "disk-xxx"
21-
disk_backup_name = "xxx"
19+
resource "tencentcloud_cbs_storage" "example" {
20+
storage_name = "tf-example"
21+
storage_type = "CLOUD_SSD"
22+
storage_size = 100
23+
availability_zone = "ap-guangzhou-6"
24+
project_id = 0
25+
encrypt = false
26+
disk_backup_quota = 3
27+
28+
tags = {
29+
createBy = "Terraform"
30+
}
31+
}
32+
33+
resource "tencentcloud_cbs_disk_backup" "example" {
34+
disk_id = tencentcloud_cbs_storage.example.id
35+
disk_backup_name = "tf-example"
2236
}
2337
```
2438

@@ -39,9 +53,9 @@ In addition to all arguments above, the following attributes are exported:
3953

4054
## Import
4155

42-
cbs disk_backup can be imported using the id, e.g.
56+
CBS disk backup can be imported using the id, e.g.
4357

4458
```
45-
terraform import tencentcloud_cbs_disk_backup.disk_backup disk_backup_id
59+
terraform import tencentcloud_cbs_disk_backup.example dbp-qax6zwvr
4660
```
4761

0 commit comments

Comments
 (0)