From 5c34bf57f458a074a61828b38bf25c7489dc8f9e Mon Sep 17 00:00:00 2001 From: hellertang Date: Tue, 14 May 2024 16:25:13 +0800 Subject: [PATCH 1/2] modify the limit of period and charge type --- tencentcloud/services/cvm/extension_cvm.go | 4 +++- tencentcloud/services/cvm/resource_tc_instance.go | 4 ++-- website/docs/r/instance.html.markdown | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tencentcloud/services/cvm/extension_cvm.go b/tencentcloud/services/cvm/extension_cvm.go index f45b12a5ec..e0d8dd1fc2 100644 --- a/tencentcloud/services/cvm/extension_cvm.go +++ b/tencentcloud/services/cvm/extension_cvm.go @@ -5,6 +5,7 @@ const ( CVM_CHARGE_TYPE_POSTPAID = "POSTPAID_BY_HOUR" CVM_CHARGE_TYPE_SPOTPAID = "SPOTPAID" CVM_CHARGE_TYPE_CDHPAID = "CDHPAID" + CVM_CHARGE_TYPE_CDCPAID = "CDCPAID" CVM_CHARGE_TYPE_UNDERWRITE = "UNDERWRITE" CVM_INTERNET_CHARGE_TYPE_BANDWIDTH_PREPAID = "BANDWIDTH_PREPAID" @@ -80,6 +81,7 @@ var CVM_CHARGE_TYPE = []string{ CVM_CHARGE_TYPE_POSTPAID, CVM_CHARGE_TYPE_SPOTPAID, CVM_CHARGE_TYPE_CDHPAID, + CVM_CHARGE_TYPE_CDCPAID, CVM_CHARGE_TYPE_UNDERWRITE, } @@ -90,7 +92,7 @@ var CVM_INTERNET_CHARGE_TYPE = []string{ CVM_INTERNET_CHARGE_TYPE_TRAFFIC_POSTPAID, } -var CVM_PREPAID_PERIOD = []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, 36} +var CVM_PREPAID_PERIOD = []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, 36, 48, 60} var CVM_PREPAID_RENEW_FLAG = []string{ CVM_PREPAID_RENEW_FLAG_NOTIFY_NOTIFY_AND_AUTO_RENEW, diff --git a/tencentcloud/services/cvm/resource_tc_instance.go b/tencentcloud/services/cvm/resource_tc_instance.go index 7dc925baef..eb1bdad5f4 100644 --- a/tencentcloud/services/cvm/resource_tc_instance.go +++ b/tencentcloud/services/cvm/resource_tc_instance.go @@ -107,13 +107,13 @@ func ResourceTencentCloudInstance() *schema.Resource { Optional: true, Default: CVM_CHARGE_TYPE_POSTPAID, ValidateFunc: tccommon.ValidateAllowedStringValue(CVM_CHARGE_TYPE), - Description: "The charge type of instance. Valid values are `PREPAID`, `POSTPAID_BY_HOUR`, `SPOTPAID` and `CDHPAID`. The default is `POSTPAID_BY_HOUR`. Note: TencentCloud International only supports `POSTPAID_BY_HOUR` and `CDHPAID`. `PREPAID` instance may not allow to delete before expired. `SPOTPAID` instance must set `spot_instance_type` and `spot_max_price` at the same time. `CDHPAID` instance must set `cdh_instance_type` and `cdh_host_id`.", + Description: "The charge type of instance. Valid values are `PREPAID`, `POSTPAID_BY_HOUR`, `SPOTPAID`, `CDHPAID` and `CDCPAID`. The default is `POSTPAID_BY_HOUR`. Note: TencentCloud International only supports `POSTPAID_BY_HOUR` and `CDHPAID`. `PREPAID` instance may not allow to delete before expired. `SPOTPAID` instance must set `spot_instance_type` and `spot_max_price` at the same time. `CDHPAID` instance must set `cdh_instance_type` and `cdh_host_id`.", }, "instance_charge_type_prepaid_period": { Type: schema.TypeInt, Optional: true, ValidateFunc: tccommon.ValidateAllowedIntValue(CVM_PREPAID_PERIOD), - Description: "The tenancy (time unit is month) of the prepaid instance, NOTE: it only works when instance_charge_type is set to `PREPAID`. Valid values are `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`, `9`, `10`, `11`, `12`, `24`, `36`.", + Description: "The tenancy (time unit is month) of the prepaid instance, NOTE: it only works when instance_charge_type is set to `PREPAID`. Valid values are `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`, `9`, `10`, `11`, `12`, `24`, `36`, `48`, `60`.", }, "instance_charge_type_prepaid_renew_flag": { Type: schema.TypeString, diff --git a/website/docs/r/instance.html.markdown b/website/docs/r/instance.html.markdown index 21a3e4907e..799a5ca57a 100644 --- a/website/docs/r/instance.html.markdown +++ b/website/docs/r/instance.html.markdown @@ -120,9 +120,9 @@ The following arguments are supported: * `disable_security_service` - (Optional, Bool) Disable enhance service for security, it is enabled by default. When this options is set, security agent won't be installed. Modifying will cause the instance reset. * `force_delete` - (Optional, Bool) Indicate whether to force delete the instance. Default is `false`. If set true, the instance will be permanently deleted instead of being moved into the recycle bin. Note: only works for `PREPAID` instance. * `hostname` - (Optional, String) The hostname of the instance. Windows instance: The name should be a combination of 2 to 15 characters comprised of letters (case insensitive), numbers, and hyphens (-). Period (.) is not supported, and the name cannot be a string of pure numbers. Other types (such as Linux) of instances: The name should be a combination of 2 to 60 characters, supporting multiple periods (.). The piece between two periods is composed of letters (case insensitive), numbers, and hyphens (-). Modifying will cause the instance reset. -* `instance_charge_type_prepaid_period` - (Optional, Int) The tenancy (time unit is month) of the prepaid instance, NOTE: it only works when instance_charge_type is set to `PREPAID`. Valid values are `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`, `9`, `10`, `11`, `12`, `24`, `36`. +* `instance_charge_type_prepaid_period` - (Optional, Int) The tenancy (time unit is month) of the prepaid instance, NOTE: it only works when instance_charge_type is set to `PREPAID`. Valid values are `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`, `9`, `10`, `11`, `12`, `24`, `36`, `48`, `60`. * `instance_charge_type_prepaid_renew_flag` - (Optional, String) Auto renewal flag. Valid values: `NOTIFY_AND_AUTO_RENEW`: notify upon expiration and renew automatically, `NOTIFY_AND_MANUAL_RENEW`: notify upon expiration but do not renew automatically, `DISABLE_NOTIFY_AND_MANUAL_RENEW`: neither notify upon expiration nor renew automatically. Default value: `NOTIFY_AND_MANUAL_RENEW`. If this parameter is specified as `NOTIFY_AND_AUTO_RENEW`, the instance will be automatically renewed on a monthly basis if the account balance is sufficient. NOTE: it only works when instance_charge_type is set to `PREPAID`. -* `instance_charge_type` - (Optional, String) The charge type of instance. Valid values are `PREPAID`, `POSTPAID_BY_HOUR`, `SPOTPAID` and `CDHPAID`. The default is `POSTPAID_BY_HOUR`. Note: TencentCloud International only supports `POSTPAID_BY_HOUR` and `CDHPAID`. `PREPAID` instance may not allow to delete before expired. `SPOTPAID` instance must set `spot_instance_type` and `spot_max_price` at the same time. `CDHPAID` instance must set `cdh_instance_type` and `cdh_host_id`. +* `instance_charge_type` - (Optional, String) The charge type of instance. Valid values are `PREPAID`, `POSTPAID_BY_HOUR`, `SPOTPAID`, `CDHPAID` and `CDCPAID`. The default is `POSTPAID_BY_HOUR`. Note: TencentCloud International only supports `POSTPAID_BY_HOUR` and `CDHPAID`. `PREPAID` instance may not allow to delete before expired. `SPOTPAID` instance must set `spot_instance_type` and `spot_max_price` at the same time. `CDHPAID` instance must set `cdh_instance_type` and `cdh_host_id`. * `instance_count` - (Optional, Int, **Deprecated**) It has been deprecated from version 1.59.18. Use built-in `count` instead. The number of instances to be purchased. Value range:[1,100]; default value: 1. * `instance_name` - (Optional, String) The name of the instance. The max length of instance_name is 60, and default value is `Terraform-CVM-Instance`. * `instance_type` - (Optional, String) The type of the instance. From 272c3c253469177060e1de1ce493b5df8c012dd5 Mon Sep 17 00:00:00 2001 From: hellertang Date: Tue, 14 May 2024 16:33:33 +0800 Subject: [PATCH 2/2] add changelog --- .changelog/2630.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/2630.txt diff --git a/.changelog/2630.txt b/.changelog/2630.txt new file mode 100644 index 0000000000..5064ac99d8 --- /dev/null +++ b/.changelog/2630.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/tencentcloud_instance: Update the limit of period and charge type +``` \ No newline at end of file