Skip to content

Commit c4543be

Browse files
committed
test: modify tencentcloud_cvm_modify_instance_disk_type test
1 parent 273d9f1 commit c4543be

File tree

1 file changed

+39
-23
lines changed

1 file changed

+39
-23
lines changed

tencentcloud/services/cvm/resource_tc_cvm_modify_instance_disk_type_test.go

Lines changed: 39 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,39 +18,55 @@ func TestAccTencentCloudNeedFixCvmModifyInstanceDiskTypeResource_basic(t *testin
1818
Steps: []resource.TestStep{
1919
{
2020
Config: testAccCvmModifyInstanceDiskType,
21-
Check: resource.ComposeTestCheckFunc(resource.TestCheckResourceAttrSet("tencentcloud_cvm_modify_instance_disk_type.modify_instance_disk_type", "id")),
22-
},
23-
{
24-
ResourceName: "tencentcloud_cvm_modify_instance_disk_type.modify_instance_disk_type",
25-
ImportState: true,
26-
ImportStateVerify: true,
21+
Check: resource.ComposeTestCheckFunc(resource.TestCheckResourceAttrSet("tencentcloud_cvm_modify_instance_disk_type.modify_disk_type", "id")),
2722
},
2823
},
2924
})
3025
}
3126

3227
const testAccCvmModifyInstanceDiskType = `
28+
data "tencentcloud_images" "default" {
29+
image_type = ["PUBLIC_IMAGE"]
30+
image_name_regex = "Final"
31+
}
32+
data "tencentcloud_instance_types" "default" {
33+
memory_size = 2
34+
exclude_sold_out = true
35+
filter {
36+
name = "instance-family"
37+
values = ["SA2","SA3","SA4","SA5","S2","S3"]
38+
}
39+
filter {
40+
name = "zone"
41+
values = ["ap-guangzhou-7"]
42+
}
43+
cpu_core_count = 2
44+
}
3345
34-
resource "tencentcloud_cvm_modify_instance_disk_type" "modify_instance_disk_type" {
35-
instance_id = "ins-r8hr2upy"
46+
resource "tencentcloud_instance" "test_cvm" {
47+
image_id = data.tencentcloud_images.default.images.0.image_id
48+
availability_zone = "ap-guangzhou-7"
49+
instance_type = "SA2.MEDIUM2"
50+
orderly_security_groups = ["sg-5275dorp"]
51+
instance_charge_type = "POSTPAID_BY_HOUR"
3652
data_disks {
37-
disk_size = 50
38-
disk_type = "CLOUD_BASIC"
39-
disk_id = "disk-hrsd0u81"
40-
delete_with_instance = true
41-
snapshot_id = "snap-r9unnd89"
42-
encrypt = false
43-
kms_key_id = "kms-abcd1234"
44-
throughput_performance = 2
45-
cdc_id = "cdc-b9pbd3px"
46-
53+
data_disk_size = 50
54+
data_disk_type = "CLOUD_PREMIUM"
4755
}
48-
system_disk {
49-
disk_type = "CLOUD_PREMIUM"
50-
disk_id = "disk-1drr53sd"
51-
disk_size = 50
52-
cdc_id = "cdc-b9pbd3px"
56+
running_flag = false
57+
}
5358
59+
resource "tencentcloud_cvm_modify_instance_disk_type" "modify_disk_type" {
60+
instance_id = tencentcloud_instance.test_cvm.id
61+
system_disk {
62+
disk_type = "CLOUD_SSD"
63+
disk_size = 50
64+
}
65+
data_disks {
66+
disk_type = "CLOUD_SSD"
67+
disk_size = 50
68+
delete_with_instance = true
69+
throughput_performance = 100
5470
}
5571
}
5672

0 commit comments

Comments
 (0)