Skip to content

Commit ab0e55f

Browse files
authored
Merge pull request #591 from ChrisdeR/master
Add internet_max_bandwidth_out and public_ip_assigned for resource tke node pool
2 parents 223f706 + eabd52d commit ab0e55f

File tree

4 files changed

+41
-5
lines changed

4 files changed

+41
-5
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
## 1.53.7 (Unreleased)
1+
## 1.53.8 (Unreleased)
2+
## 1.53.7 (March 09, 2021)
3+
4+
ENHANCEMENTS:
5+
6+
* Resource `tencentcloud_kubernetes_node_pool` add `internet_max_bandwidth_out`, `public_ip_assigned` to support internet traffic setting.
7+
28
## 1.53.6 (March 09, 2021)
39

410
ENHANCEMENTS:

tencentcloud/resource_tc_kubernetes_node_pool.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ resource "tencentcloud_kubernetes_node_pool" "mynodepool" {
6060
}
6161
6262
internet_charge_type = "TRAFFIC_POSTPAID_BY_HOUR"
63+
internet_max_bandwidth_out = 10
64+
public_ip_assigned = true
6365
password = "test123#"
6466
enhanced_security_service = false
6567
enhanced_monitor_service = false
@@ -170,6 +172,19 @@ func composedKubernetesAsScalingConfigPara() map[string]*schema.Schema {
170172
ValidateFunc: validateAllowedStringValue(INTERNET_CHARGE_ALLOW_TYPE),
171173
Description: "Charge types for network traffic. Valid value: `BANDWIDTH_PREPAID`, `TRAFFIC_POSTPAID_BY_HOUR`, `TRAFFIC_POSTPAID_BY_HOUR` and `BANDWIDTH_PACKAGE`.",
172174
},
175+
"internet_max_bandwidth_out": {
176+
Type: schema.TypeInt,
177+
Optional: true,
178+
ForceNew: true,
179+
Default: 0,
180+
Description: "Max bandwidth of Internet access in Mbps. Default is `0`.",
181+
},
182+
"public_ip_assigned": {
183+
Type: schema.TypeBool,
184+
Optional: true,
185+
ForceNew: true,
186+
Description: "Specify whether to assign an Internet IP address.",
187+
},
173188
"password": {
174189
Type: schema.TypeString,
175190
Optional: true,
@@ -474,6 +489,13 @@ func comosedKubernetesAsScalingConfigParaSerial(dMap map[string]interface{}, met
474489
if v, ok := dMap["internet_charge_type"]; ok {
475490
request.InternetAccessible.InternetChargeType = helper.String(v.(string))
476491
}
492+
if v, ok := dMap["internet_max_bandwidth_out"]; ok {
493+
request.InternetAccessible.InternetMaxBandwidthOut = helper.IntUint64(v.(int))
494+
}
495+
if v, ok := dMap["public_ip_assigned"]; ok {
496+
publicIpAssigned := v.(bool)
497+
request.InternetAccessible.PublicIpAssigned = &publicIpAssigned
498+
}
477499

478500
request.LoginSettings = &as.LoginSettings{}
479501

tencentcloud/resource_tc_kubernetes_node_pool_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ resource "tencentcloud_kubernetes_node_pool" "np_test" {
200200
}
201201
202202
internet_charge_type = "TRAFFIC_POSTPAID_BY_HOUR"
203+
internet_max_bandwidth_out = 10
204+
public_ip_assigned = true
203205
password = "test123#"
204206
enhanced_security_service = false
205207
enhanced_monitor_service = false
@@ -252,6 +254,8 @@ resource "tencentcloud_kubernetes_node_pool" "np_test" {
252254
}
253255
254256
internet_charge_type = "TRAFFIC_POSTPAID_BY_HOUR"
257+
internet_max_bandwidth_out = 10
258+
public_ip_assigned = true
255259
password = "test123#"
256260
enhanced_security_service = false
257261
enhanced_monitor_service = false

website/docs/r/kubernetes_node_pool.html.markdown

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,12 @@ resource "tencentcloud_kubernetes_node_pool" "mynodepool" {
6868
disk_size = 50
6969
}
7070
71-
internet_charge_type = "TRAFFIC_POSTPAID_BY_HOUR"
72-
password = "test123#"
73-
enhanced_security_service = false
74-
enhanced_monitor_service = false
71+
internet_charge_type = "TRAFFIC_POSTPAID_BY_HOUR"
72+
internet_max_bandwidth_out = 10
73+
public_ip_assigned = true
74+
password = "test123#"
75+
enhanced_security_service = false
76+
enhanced_monitor_service = false
7577
7678
}
7779
@@ -129,8 +131,10 @@ The `auto_scaling_config` object supports the following:
129131
* `enhanced_monitor_service` - (Optional, ForceNew) To specify whether to enable cloud monitor service. Default is TRUE.
130132
* `enhanced_security_service` - (Optional, ForceNew) To specify whether to enable cloud security service. Default is TRUE.
131133
* `internet_charge_type` - (Optional, ForceNew) Charge types for network traffic. Valid value: `BANDWIDTH_PREPAID`, `TRAFFIC_POSTPAID_BY_HOUR`, `TRAFFIC_POSTPAID_BY_HOUR` and `BANDWIDTH_PACKAGE`.
134+
* `internet_max_bandwidth_out` - (Optional, ForceNew) Max bandwidth of Internet access in Mbps. Default is `0`.
132135
* `key_ids` - (Optional, ForceNew) ID list of keys.
133136
* `password` - (Optional, ForceNew) Password to access.
137+
* `public_ip_assigned` - (Optional, ForceNew) Specify whether to assign an Internet IP address.
134138
* `security_group_ids` - (Optional, ForceNew) Security groups to which a CVM instance belongs.
135139
* `system_disk_size` - (Optional, ForceNew) Volume of system disk in GB. Default is `50`.
136140
* `system_disk_type` - (Optional, ForceNew) Type of a CVM disk. Valid value: `CLOUD_PREMIUM` and `CLOUD_SSD`. Default is `CLOUD_PREMIUM`.

0 commit comments

Comments
 (0)