Skip to content

Commit ce39754

Browse files
authored
Merge pull request #1299 from tencentcloudstack/feat/fix_ckakfa_paninc
fix ckafka panic
2 parents e9ea9a0 + fce2dda commit ce39754

9 files changed

+32
-28
lines changed

tencentcloud/resource_tc_cbs_storage.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,12 @@ func resourceTencentCloudCbsStorage() *schema.Resource {
5454
Type: schema.TypeString,
5555
Required: true,
5656
ForceNew: true,
57-
Description: "Type of CBS medium. Valid values: CLOUD_PREMIUM, CLOUD_SSD, CLOUD_TSSD and CLOUD_HSSD.",
57+
Description: "Type of CBS medium. Valid values: CLOUD_BASIC: HDD cloud disk, CLOUD_PREMIUM: Premium Cloud Storage, CLOUD_BSSD: General Purpose SSD, CLOUD_SSD: SSD, CLOUD_HSSD: Enhanced SSD, CLOUD_TSSD: Tremendous SSD.",
5858
},
5959
"storage_size": {
60-
Type: schema.TypeInt,
61-
Required: true,
62-
ValidateFunc: validateIntegerInRange(10, 16000),
63-
Description: "Volume of CBS, and unit is GB. If storage type is `CLOUD_SSD`, the size range is [100, 16000], and the others are [10-16000].",
60+
Type: schema.TypeInt,
61+
Required: true,
62+
Description: "Volume of CBS, and unit is GB.",
6463
},
6564
"period": {
6665
Deprecated: "It has been deprecated from version 1.33.0. Set `prepaid_period` instead.",

tencentcloud/resource_tc_cbs_storage_set.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,12 @@ func resourceTencentCloudCbsStorageSet() *schema.Resource {
4545
Type: schema.TypeString,
4646
Required: true,
4747
ForceNew: true,
48-
Description: "Type of CBS medium. Valid values: CLOUD_PREMIUM, CLOUD_SSD, CLOUD_TSSD and CLOUD_HSSD.",
48+
Description: "Type of CBS medium. Valid values: CLOUD_BASIC: HDD cloud disk, CLOUD_PREMIUM: Premium Cloud Storage, CLOUD_BSSD: General Purpose SSD, CLOUD_SSD: SSD, CLOUD_HSSD: Enhanced SSD, CLOUD_TSSD: Tremendous SSD.",
4949
},
5050
"storage_size": {
51-
Type: schema.TypeInt,
52-
Required: true,
53-
ValidateFunc: validateIntegerInRange(10, 16000),
54-
Description: "Volume of CBS, and unit is GB. If storage type is `CLOUD_SSD`, the size range is [100, 16000], and the others are [10-16000].",
51+
Type: schema.TypeInt,
52+
Required: true,
53+
Description: "Volume of CBS, and unit is GB.",
5554
},
5655
"disk_count": {
5756
Type: schema.TypeInt,

tencentcloud/resource_tc_ckafka_instance.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,7 @@ func resourceTencentCloudCkafkaInstanceRead(d *schema.ResourceData, meta interfa
477477
instanceId := d.Id()
478478

479479
var info *ckafka.InstanceDetail
480+
var isExist = true
480481

481482
err := resource.Retry(readRetryTimeout, func() *resource.RetryError {
482483
res, has, e := service.DescribeCkafkaInstanceById(ctx, instanceId)
@@ -485,6 +486,7 @@ func resourceTencentCloudCkafkaInstanceRead(d *schema.ResourceData, meta interfa
485486
}
486487
if !has {
487488
d.SetId("")
489+
isExist = false
488490
return nil
489491
}
490492
info = res
@@ -493,6 +495,11 @@ func resourceTencentCloudCkafkaInstanceRead(d *schema.ResourceData, meta interfa
493495
if err != nil {
494496
return fmt.Errorf("[API]Describe kafka instance fail, reason:%s", err.Error())
495497
}
498+
499+
if !isExist {
500+
return nil
501+
}
502+
496503
_ = d.Set("instance_name", info.InstanceName)
497504
_ = d.Set("zone_id", info.ZoneId)
498505
// calculate period

tencentcloud/resource_tc_instance.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -337,14 +337,13 @@ func resourceTencentCloudInstance() *schema.Resource {
337337
Optional: true,
338338
Default: CVM_DISK_TYPE_CLOUD_PREMIUM,
339339
ValidateFunc: validateAllowedStringValue(CVM_DISK_TYPE),
340-
Description: "System disk type. For more information on limits of system disk types, see [Storage Overview](https://intl.cloud.tencent.com/document/product/213/4952). Valid values: `LOCAL_BASIC`: local disk, `LOCAL_SSD`: local SSD disk, `CLOUD_SSD`: SSD, `CLOUD_PREMIUM`: Premium Cloud Storage, `CLOUD_BSSD`: Basic SSD. NOTE: 1. `CLOUD_BASIC`, `LOCAL_BASIC` and `LOCAL_SSD` are deprecated; 2. If modified, the instance may force stop.",
340+
Description: "System disk type. For more information on limits of system disk types, see [Storage Overview](https://intl.cloud.tencent.com/document/product/213/4952). Valid values: `LOCAL_BASIC`: local disk, `LOCAL_SSD`: local SSD disk, `CLOUD_SSD`: SSD, `CLOUD_PREMIUM`: Premium Cloud Storage, `CLOUD_BSSD`: Basic SSD. NOTE: If modified, the instance may force stop.",
341341
},
342342
"system_disk_size": {
343-
Type: schema.TypeInt,
344-
Optional: true,
345-
Default: 50,
346-
ValidateFunc: validateIntegerInRange(50, 1000),
347-
Description: "Size of the system disk. Valid value ranges: (50~1000). and unit is GB. Default is 50GB. If modified, the instance may force stop.",
343+
Type: schema.TypeInt,
344+
Optional: true,
345+
Default: 50,
346+
Description: "Size of the system disk. unit is GB, Default is 50GB. If modified, the instance may force stop.",
348347
},
349348
"system_disk_id": {
350349
Type: schema.TypeString,
@@ -365,13 +364,13 @@ func resourceTencentCloudInstance() *schema.Resource {
365364
Type: schema.TypeString,
366365
Required: true,
367366
ForceNew: true,
368-
Description: "Data disk type. For more information about limits on different data disk types, see [Storage Overview](https://intl.cloud.tencent.com/document/product/213/4952). Valid values: `LOCAL_BASIC`: local disk, `LOCAL_SSD`: local SSD disk, `CLOUD_PREMIUM`: Premium Cloud Storage, `CLOUD_SSD`: SSD, `CLOUD_HSSD`: Enhanced SSD. NOTE: `CLOUD_BASIC`, `LOCAL_BASIC` and `LOCAL_SSD` are deprecated.",
367+
Description: "Data disk type. For more information about limits on different data disk types, see [Storage Overview](https://intl.cloud.tencent.com/document/product/213/4952). Valid values: LOCAL_BASIC: local disk, LOCAL_SSD: local SSD disk, LOCAL_NVME: local NVME disk, specified in the InstanceType, LOCAL_PRO: local HDD disk, specified in the InstanceType, CLOUD_BASIC: HDD cloud disk, CLOUD_PREMIUM: Premium Cloud Storage, CLOUD_SSD: SSD, CLOUD_HSSD: Enhanced SSD, CLOUD_TSSD: Tremendous SSD, CLOUD_BSSD: Balanced SSD.",
369368
},
370369
"data_disk_size": {
371370
Type: schema.TypeInt,
372371
Required: true,
373372
//ForceNew: true,
374-
Description: "Size of the data disk, and unit is GB. If disk type is `CLOUD_SSD`, the size range is [100, 16000], and the others are [10-16000].",
373+
Description: "Size of the data disk, and unit is GB.",
375374
},
376375
"data_disk_snapshot_id": {
377376
Type: schema.TypeString,

tencentcloud/resource_tc_instance_set.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ func resourceTencentCloudInstanceSet() *schema.Resource {
220220
Optional: true,
221221
Default: CVM_DISK_TYPE_CLOUD_PREMIUM,
222222
ValidateFunc: validateAllowedStringValue(CVM_DISK_TYPE),
223-
Description: "System disk type. For more information on limits of system disk types, see [Storage Overview](https://intl.cloud.tencent.com/document/product/213/4952). Valid values: `LOCAL_BASIC`: local disk, `LOCAL_SSD`: local SSD disk, `CLOUD_SSD`: SSD, `CLOUD_PREMIUM`: Premium Cloud Storage. NOTE: 1. `CLOUD_BASIC`, `LOCAL_BASIC` and `LOCAL_SSD` are deprecated; 2. If modified, the instance may force stop.",
223+
Description: "System disk type. For more information on limits of system disk types, see [Storage Overview](https://intl.cloud.tencent.com/document/product/213/4952). Valid values: `LOCAL_BASIC`: local disk, `LOCAL_SSD`: local SSD disk, `CLOUD_SSD`: SSD, `CLOUD_PREMIUM`: Premium Cloud Storage, `CLOUD_BSSD`: Basic SSD. NOTE: If modified, the instance may force stop.",
224224
},
225225
"system_disk_size": {
226226
Type: schema.TypeInt,

website/docs/r/cbs_storage.html.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ The following arguments are supported:
3434

3535
* `availability_zone` - (Required, String, ForceNew) The available zone that the CBS instance locates at.
3636
* `storage_name` - (Required, String) Name of CBS. The maximum length can not exceed 60 bytes.
37-
* `storage_size` - (Required, Int) Volume of CBS, and unit is GB. If storage type is `CLOUD_SSD`, the size range is [100, 16000], and the others are [10-16000].
38-
* `storage_type` - (Required, String, ForceNew) Type of CBS medium. Valid values: CLOUD_PREMIUM, CLOUD_SSD, CLOUD_TSSD and CLOUD_HSSD.
37+
* `storage_size` - (Required, Int) Volume of CBS, and unit is GB.
38+
* `storage_type` - (Required, String, ForceNew) Type of CBS medium. Valid values: CLOUD_BASIC: HDD cloud disk, CLOUD_PREMIUM: Premium Cloud Storage, CLOUD_BSSD: General Purpose SSD, CLOUD_SSD: SSD, CLOUD_HSSD: Enhanced SSD, CLOUD_TSSD: Tremendous SSD.
3939
* `charge_type` - (Optional, String) The charge type of CBS instance. Valid values are `PREPAID` and `POSTPAID_BY_HOUR`. The default is `POSTPAID_BY_HOUR`.
4040
* `encrypt` - (Optional, Bool, ForceNew) Indicates whether CBS is encrypted.
4141
* `force_delete` - (Optional, Bool) Indicate whether to delete CBS instance directly or not. Default is false. If set true, the instance will be deleted instead of staying recycle bin.

website/docs/r/cbs_storage_set.html.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ The following arguments are supported:
3131

3232
* `availability_zone` - (Required, String, ForceNew) The available zone that the CBS instance locates at.
3333
* `storage_name` - (Required, String) Name of CBS. The maximum length can not exceed 60 bytes.
34-
* `storage_size` - (Required, Int) Volume of CBS, and unit is GB. If storage type is `CLOUD_SSD`, the size range is [100, 16000], and the others are [10-16000].
35-
* `storage_type` - (Required, String, ForceNew) Type of CBS medium. Valid values: CLOUD_PREMIUM, CLOUD_SSD, CLOUD_TSSD and CLOUD_HSSD.
34+
* `storage_size` - (Required, Int) Volume of CBS, and unit is GB.
35+
* `storage_type` - (Required, String, ForceNew) Type of CBS medium. Valid values: CLOUD_BASIC: HDD cloud disk, CLOUD_PREMIUM: Premium Cloud Storage, CLOUD_BSSD: General Purpose SSD, CLOUD_SSD: SSD, CLOUD_HSSD: Enhanced SSD, CLOUD_TSSD: Tremendous SSD.
3636
* `charge_type` - (Optional, String) The charge type of CBS instance. Only support `POSTPAID_BY_HOUR`.
3737
* `disk_count` - (Optional, Int, ForceNew) The number of disks to be purchased. Default 1.
3838
* `encrypt` - (Optional, Bool, ForceNew) Indicates whether CBS is encrypted.

website/docs/r/instance.html.markdown

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,17 +173,17 @@ The following arguments are supported:
173173
* `stopped_mode` - (Optional, String) Billing method of a pay-as-you-go instance after shutdown. Available values: `KEEP_CHARGING`,`STOP_CHARGING`. Default `KEEP_CHARGING`.
174174
* `subnet_id` - (Optional, String) The ID of a VPC subnet. If you want to create instances in a VPC network, this parameter must be set.
175175
* `system_disk_id` - (Optional, String) System disk snapshot ID used to initialize the system disk. When system disk type is `LOCAL_BASIC` and `LOCAL_SSD`, disk id is not supported.
176-
* `system_disk_size` - (Optional, Int) Size of the system disk. Valid value ranges: (50~1000). and unit is GB. Default is 50GB. If modified, the instance may force stop.
177-
* `system_disk_type` - (Optional, String) System disk type. For more information on limits of system disk types, see [Storage Overview](https://intl.cloud.tencent.com/document/product/213/4952). Valid values: `LOCAL_BASIC`: local disk, `LOCAL_SSD`: local SSD disk, `CLOUD_SSD`: SSD, `CLOUD_PREMIUM`: Premium Cloud Storage, `CLOUD_BSSD`: Basic SSD. NOTE: 1. `CLOUD_BASIC`, `LOCAL_BASIC` and `LOCAL_SSD` are deprecated; 2. If modified, the instance may force stop.
176+
* `system_disk_size` - (Optional, Int) Size of the system disk. unit is GB, Default is 50GB. If modified, the instance may force stop.
177+
* `system_disk_type` - (Optional, String) System disk type. For more information on limits of system disk types, see [Storage Overview](https://intl.cloud.tencent.com/document/product/213/4952). Valid values: `LOCAL_BASIC`: local disk, `LOCAL_SSD`: local SSD disk, `CLOUD_SSD`: SSD, `CLOUD_PREMIUM`: Premium Cloud Storage, `CLOUD_BSSD`: Basic SSD. NOTE: If modified, the instance may force stop.
178178
* `tags` - (Optional, Map) A mapping of tags to assign to the resource. For tag limits, please refer to [Use Limits](https://intl.cloud.tencent.com/document/product/651/13354).
179179
* `user_data_raw` - (Optional, String, ForceNew) The user data to be injected into this instance, in plain text. Conflicts with `user_data`. Up to 16 KB after base64 encoded.
180180
* `user_data` - (Optional, String, ForceNew) The user data to be injected into this instance. Must be base64 encoded and up to 16 KB.
181181
* `vpc_id` - (Optional, String) The ID of a VPC network. If you want to create instances in a VPC network, this parameter must be set.
182182

183183
The `data_disks` object supports the following:
184184

185-
* `data_disk_size` - (Required, Int) Size of the data disk, and unit is GB. If disk type is `CLOUD_SSD`, the size range is [100, 16000], and the others are [10-16000].
186-
* `data_disk_type` - (Required, String, ForceNew) Data disk type. For more information about limits on different data disk types, see [Storage Overview](https://intl.cloud.tencent.com/document/product/213/4952). Valid values: `LOCAL_BASIC`: local disk, `LOCAL_SSD`: local SSD disk, `CLOUD_PREMIUM`: Premium Cloud Storage, `CLOUD_SSD`: SSD, `CLOUD_HSSD`: Enhanced SSD. NOTE: `CLOUD_BASIC`, `LOCAL_BASIC` and `LOCAL_SSD` are deprecated.
185+
* `data_disk_size` - (Required, Int) Size of the data disk, and unit is GB.
186+
* `data_disk_type` - (Required, String, ForceNew) Data disk type. For more information about limits on different data disk types, see [Storage Overview](https://intl.cloud.tencent.com/document/product/213/4952). Valid values: LOCAL_BASIC: local disk, LOCAL_SSD: local SSD disk, LOCAL_NVME: local NVME disk, specified in the InstanceType, LOCAL_PRO: local HDD disk, specified in the InstanceType, CLOUD_BASIC: HDD cloud disk, CLOUD_PREMIUM: Premium Cloud Storage, CLOUD_SSD: SSD, CLOUD_HSSD: Enhanced SSD, CLOUD_TSSD: Tremendous SSD, CLOUD_BSSD: Balanced SSD.
187187
* `data_disk_id` - (Optional, String) Data disk ID used to initialize the data disk. When data disk type is `LOCAL_BASIC` and `LOCAL_SSD`, disk id is not supported.
188188
* `data_disk_snapshot_id` - (Optional, String, ForceNew) Snapshot ID of the data disk. The selected data disk snapshot size must be smaller than the data disk size.
189189
* `delete_with_instance` - (Optional, Bool, ForceNew) Decides whether the disk is deleted with instance(only applied to `CLOUD_BASIC`, `CLOUD_SSD` and `CLOUD_PREMIUM` disk with `POSTPAID_BY_HOUR` instance), default is true.

website/docs/r/instance_set.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ The following arguments are supported:
102102
* `subnet_id` - (Optional, String) The ID of a VPC subnet. If you want to create instances in a VPC network, this parameter must be set.
103103
* `system_disk_id` - (Optional, String) System disk snapshot ID used to initialize the system disk. When system disk type is `LOCAL_BASIC` and `LOCAL_SSD`, disk id is not supported.
104104
* `system_disk_size` - (Optional, Int) Size of the system disk. Valid value ranges: (50~1000). and unit is GB. Default is 50GB. If modified, the instance may force stop.
105-
* `system_disk_type` - (Optional, String) System disk type. For more information on limits of system disk types, see [Storage Overview](https://intl.cloud.tencent.com/document/product/213/4952). Valid values: `LOCAL_BASIC`: local disk, `LOCAL_SSD`: local SSD disk, `CLOUD_SSD`: SSD, `CLOUD_PREMIUM`: Premium Cloud Storage. NOTE: 1. `CLOUD_BASIC`, `LOCAL_BASIC` and `LOCAL_SSD` are deprecated; 2. If modified, the instance may force stop.
105+
* `system_disk_type` - (Optional, String) System disk type. For more information on limits of system disk types, see [Storage Overview](https://intl.cloud.tencent.com/document/product/213/4952). Valid values: `LOCAL_BASIC`: local disk, `LOCAL_SSD`: local SSD disk, `CLOUD_SSD`: SSD, `CLOUD_PREMIUM`: Premium Cloud Storage, `CLOUD_BSSD`: Basic SSD. NOTE: If modified, the instance may force stop.
106106
* `user_data_raw` - (Optional, String, ForceNew) The user data to be injected into this instance, in plain text. Conflicts with `user_data`. Up to 16 KB after base64 encoded.
107107
* `user_data` - (Optional, String, ForceNew) The user data to be injected into this instance. Must be base64 encoded and up to 16 KB.
108108
* `vpc_id` - (Optional, String) The ID of a VPC network. If you want to create instances in a VPC network, this parameter must be set.

0 commit comments

Comments
 (0)