Skip to content
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/3096.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/tencentcloud_cbs_storage: fix `disk_backup_quota` update failed
```
13 changes: 6 additions & 7 deletions tencentcloud/services/cbs/resource_tc_cbs_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,13 +230,6 @@ func resourceTencentCloudCbsStorageCreate(d *schema.ResourceData, meta interface

d.SetId(storageId)

if v, ok := d.GetOk("disk_backup_quota"); ok {
err = cbsService.ModifyDiskBackupQuota(ctx, storageId, v.(int))
if err != nil {
return err
}
}

// must wait for finishing creating disk
err = resource.Retry(10*tccommon.ReadRetryTimeout, func() *resource.RetryError {
storage, e := cbsService.DescribeDiskById(ctx, storageId)
Expand All @@ -254,6 +247,12 @@ func resourceTencentCloudCbsStorageCreate(d *schema.ResourceData, meta interface
if err != nil {
return err
}
if v, ok := d.GetOk("disk_backup_quota"); ok {
err = cbsService.ModifyDiskBackupQuota(ctx, storageId, v.(int))
if err != nil {
return err
}
}

return resourceTencentCloudCbsStorageRead(d, meta)
}
Expand Down
2 changes: 0 additions & 2 deletions tencentcloud/services/cbs/resource_tc_cbs_storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ func init() {
}

func TestAccTencentCloudCbsStorageResource_basic(t *testing.T) {
t.Parallel()

resource.Test(t, resource.TestCase{
PreCheck: func() { tcacctest.AccPreCheck(t) },
Expand Down Expand Up @@ -106,7 +105,6 @@ func TestAccTencentCloudCbsStorageResource_basic(t *testing.T) {
}

func TestAccTencentCloudCbsStorageResource_full(t *testing.T) {
t.Parallel()

resource.Test(t, resource.TestCase{
PreCheck: func() { tcacctest.AccPreCheck(t) },
Expand Down
Loading