Skip to content

Commit 944d5e6

Browse files
author
mikatong
committed
support hpc_cluster_id
1 parent 0d20e79 commit 944d5e6

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

tencentcloud/services/cvm/resource_tc_instance.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,13 @@ func ResourceTencentCloudInstance() *schema.Resource {
420420
Optional: true,
421421
Description: "CAM role name authorized to access.",
422422
},
423+
"hpc_cluster_id": {
424+
Type: schema.TypeString,
425+
Optional: true,
426+
Computed: true,
427+
ForceNew: true,
428+
Description: "High-performance computing cluster ID. If the instance created is a high-performance computing instance, you need to specify the cluster in which the instance is placed, otherwise it cannot be specified.",
429+
},
423430
// Computed values.
424431
"instance_status": {
425432
Type: schema.TypeString,
@@ -509,6 +516,10 @@ func resourceTencentCloudInstanceCreate(d *schema.ResourceData, meta interface{}
509516
request.CamRoleName = helper.String(v.(string))
510517
}
511518

519+
if v, ok := d.GetOk("hpc_cluster_id"); ok {
520+
request.HpcClusterId = helper.String(v.(string))
521+
}
522+
512523
if v, ok := d.GetOk("instance_charge_type"); ok {
513524
instanceChargeType := v.(string)
514525
request.InstanceChargeType = &instanceChargeType
@@ -959,6 +970,7 @@ func resourceTencentCloudInstanceRead(d *schema.ResourceData, meta interface{})
959970
_ = d.Set("cpu", instance.CPU)
960971
_ = d.Set("memory", instance.Memory)
961972
_ = d.Set("os_name", instance.OsName)
973+
_ = d.Set("hpc_cluster_id", instance.HpcClusterId)
962974

963975
if instance.Uuid != nil {
964976
_ = d.Set("uuid", instance.Uuid)

website/docs/r/instance.html.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ The following arguments are supported:
230230
* `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. Modifications may lead to the reinstallation of the instance's operating system.
231231
* `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.
232232
* `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 (-). Modifications may lead to the reinstallation of the instance's operating system.
233+
* `hpc_cluster_id` - (Optional, String, ForceNew) High-performance computing cluster ID. If the instance created is a high-performance computing instance, you need to specify the cluster in which the instance is placed, otherwise it cannot be specified.
233234
* `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`.
234235
* `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`.
235236
* `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`.

0 commit comments

Comments
 (0)