Skip to content

fix(cbs): [137144765] tencentcloud_cbs_disk_backup update resource creation error message #3129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/3129.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/tencentcloud_cbs_disk_backup: update resource creation error message
```
2 changes: 1 addition & 1 deletion tencentcloud/services/cbs/resource_tc_cbs_disk_backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func resourceTencentCloudCbsDiskBackupCreate(d *schema.ResourceData, meta interf
service := CbsService{client: meta.(tccommon.ProviderMeta).GetAPIV3Conn()}
diskBackupId, err := service.CreateDiskBackup(ctx, diskId, diskBackupName)
if err != nil {
return nil
return err
}
d.SetId(diskBackupId)
err = resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError {
Expand Down
32 changes: 22 additions & 10 deletions tencentcloud/services/cbs/resource_tc_cbs_disk_backup.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,34 @@
Provides a resource to create a cbs disk_backup.
Provides a resource to create a CBS disk backup.

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

Example Usage

```hcl

resource "tencentcloud_cbs_disk_backup" "disk_backup" {
disk_id = "disk-xxx"
disk_backup_name = "xxx"
}

resource "tencentcloud_cbs_storage" "example" {
storage_name = "tf-example"
storage_type = "CLOUD_SSD"
storage_size = 100
availability_zone = "ap-guangzhou-6"
project_id = 0
encrypt = false
disk_backup_quota = 3

tags = {
createBy = "Terraform"
}
}

resource "tencentcloud_cbs_disk_backup" "example" {
disk_id = tencentcloud_cbs_storage.example.id
disk_backup_name = "tf-example"
}
```

Import

cbs disk_backup can be imported using the id, e.g.
CBS disk backup can be imported using the id, e.g.

```
terraform import tencentcloud_cbs_disk_backup.disk_backup disk_backup_id
terraform import tencentcloud_cbs_disk_backup.example dbp-qax6zwvr
```
30 changes: 22 additions & 8 deletions website/docs/r/cbs_disk_backup.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,35 @@ layout: "tencentcloud"
page_title: "TencentCloud: tencentcloud_cbs_disk_backup"
sidebar_current: "docs-tencentcloud-resource-cbs_disk_backup"
description: |-
Provides a resource to create a cbs disk_backup.
Provides a resource to create a CBS disk backup.
---

# tencentcloud_cbs_disk_backup

Provides a resource to create a cbs disk_backup.
Provides a resource to create a CBS disk backup.

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

## Example Usage

```hcl
resource "tencentcloud_cbs_disk_backup" "disk_backup" {
disk_id = "disk-xxx"
disk_backup_name = "xxx"
resource "tencentcloud_cbs_storage" "example" {
storage_name = "tf-example"
storage_type = "CLOUD_SSD"
storage_size = 100
availability_zone = "ap-guangzhou-6"
project_id = 0
encrypt = false
disk_backup_quota = 3

tags = {
createBy = "Terraform"
}
}

resource "tencentcloud_cbs_disk_backup" "example" {
disk_id = tencentcloud_cbs_storage.example.id
disk_backup_name = "tf-example"
}
```

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

## Import

cbs disk_backup can be imported using the id, e.g.
CBS disk backup can be imported using the id, e.g.

```
terraform import tencentcloud_cbs_disk_backup.disk_backup disk_backup_id
terraform import tencentcloud_cbs_disk_backup.example dbp-qax6zwvr
```

Loading