Skip to content

Commit e8148dd

Browse files
committed
add hostname for resource k8s cluster attachment
1 parent e2983b1 commit e8148dd

File tree

4 files changed

+43
-17
lines changed

4 files changed

+43
-17
lines changed

CHANGELOG.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
## 1.53.2 (Unreleased)
1+
## 1.53.3 (Unreleased)
2+
3+
ENHANCEMENTS:
4+
5+
* Data Source `tencentcloud_cbs_storages` add `throughput_performance` to support adding extra performance to the cbs resources.
6+
* Resource `tencentcloud_kubernetes_cluster_attachment` add `hostname` to support setting hostname with the attached instance.
7+
8+
## 1.53.2 (February 01, 2021)
29

310
ENHANCEMENTS:
411

@@ -9,7 +16,6 @@ BUG FIXES:
916
* Resource: `tencentcloud_cos_bucket` fix bug that error happens when applying unsupported logging region.
1017
* Resource: `tencentcloud_as_scaling_policy` fix bug that missing required parameters error happened when update metric parameters.
1118

12-
1319
## 1.53.1 (January 23, 2021)
1420

1521
ENHANCEMENTS:

tencentcloud/connectivity/transport.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"time"
1111
)
1212

13-
const ReqClient = "Terraform-v1.53.1"
13+
const ReqClient = "Terraform-v1.53.2"
1414

1515
type LogRoundTripper struct {
1616
}

tencentcloud/data_source_tc_cbs_storages.go

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,11 @@ func dataSourceTencentCloudCbsStorages() *schema.Resource {
144144
Computed: true,
145145
Description: "Pay type of the CBS instance.",
146146
},
147+
"throughput_performance": {
148+
Type: schema.TypeInt,
149+
Computed: true,
150+
Description: "Add extra performance to the data disk. Only works when disk type is `CLOUD_TSSD` or `CLOUD_HSSD`.",
151+
},
147152
},
148153
},
149154
},
@@ -190,20 +195,21 @@ func dataSourceTencentCloudCbsStoragesRead(d *schema.ResourceData, meta interfac
190195
storageList := make([]map[string]interface{}, 0, len(storages))
191196
for _, storage := range storages {
192197
mapping := map[string]interface{}{
193-
"storage_id": storage.DiskId,
194-
"storage_name": storage.DiskName,
195-
"storage_usage": storage.DiskUsage,
196-
"storage_type": storage.DiskType,
197-
"availability_zone": storage.Placement.Zone,
198-
"project_id": storage.Placement.ProjectId,
199-
"storage_size": storage.DiskSize,
200-
"attached": storage.Attached,
201-
"instance_id": storage.InstanceId,
202-
"encrypt": storage.Encrypt,
203-
"create_time": storage.CreateTime,
204-
"status": storage.DiskState,
205-
"prepaid_renew_flag": storage.RenewFlag,
206-
"charge_type": storage.DiskChargeType,
198+
"storage_id": storage.DiskId,
199+
"storage_name": storage.DiskName,
200+
"storage_usage": storage.DiskUsage,
201+
"storage_type": storage.DiskType,
202+
"availability_zone": storage.Placement.Zone,
203+
"project_id": storage.Placement.ProjectId,
204+
"storage_size": storage.DiskSize,
205+
"attached": storage.Attached,
206+
"instance_id": storage.InstanceId,
207+
"encrypt": storage.Encrypt,
208+
"create_time": storage.CreateTime,
209+
"status": storage.DiskState,
210+
"prepaid_renew_flag": storage.RenewFlag,
211+
"charge_type": storage.DiskChargeType,
212+
"throughput_performance": storage.ThroughputPerformance,
207213
}
208214
if storage.Tags != nil {
209215
tags := make(map[string]interface{}, len(storage.Tags))

tencentcloud/resource_tc_kubernetes_cluster_attachment.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,15 @@ func resourceTencentCloudTkeClusterAttachment() *schema.Resource {
223223
Elem: &schema.Schema{Type: schema.TypeString},
224224
Description: "The key pair to use for the instance, it looks like skey-16jig7tx, it should be set if `password` not set.",
225225
},
226+
"hostname": {
227+
Type: schema.TypeString,
228+
ForceNew: true,
229+
Optional: true,
230+
Description: "The host name of the attached instance. " +
231+
"Dot (.) and dash (-) cannot be used as the first and last characters of HostName and cannot be used consecutively. " +
232+
"Windows example: The length of the name character is [2, 15], letters (capitalization is not restricted), numbers and dashes (-) are allowed, dots (.) are not supported, and not all numbers are allowed. " +
233+
"Examples of other types (Linux, etc.): The character length is [2, 60], and multiple dots are allowed. There is a segment between the dots. Each segment allows letters (with no limitation on capitalization), numbers and dashes (-).",
234+
},
226235
"worker_config": {
227236
Type: schema.TypeList,
228237
ForceNew: true,
@@ -392,6 +401,7 @@ func resourceTencentCloudTkeClusterAttachmentRead(d *schema.ResourceData, meta i
392401
if len(instance.LoginSettings.KeyIds) > 0 {
393402
_ = d.Set("key_ids", instance.LoginSettings.KeyIds)
394403
}
404+
395405
_ = d.Set("security_groups", helper.StringsInterfaces(instance.SecurityGroupIds))
396406
return nil
397407
}
@@ -439,6 +449,10 @@ func resourceTencentCloudTkeClusterAttachmentCreate(d *schema.ResourceData, meta
439449
}
440450

441451
request.InstanceAdvancedSettings.Labels = GetTkeLabels(d, "labels")
452+
if hostName, ok := d.GetOk("hostname"); ok {
453+
hostNameStr := hostName.(string)
454+
request.HostName = &hostNameStr
455+
}
442456

443457
/*cvm has been attached*/
444458
var err error

0 commit comments

Comments
 (0)