@@ -18,39 +18,55 @@ func TestAccTencentCloudNeedFixCvmModifyInstanceDiskTypeResource_basic(t *testin
18
18
Steps : []resource.TestStep {
19
19
{
20
20
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" )),
27
22
},
28
23
},
29
24
})
30
25
}
31
26
32
27
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
+ }
33
45
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"
36
52
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"
47
55
}
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
+ }
53
58
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
54
70
}
55
71
}
56
72
0 commit comments