Skip to content

Commit ab1f812

Browse files
author
hellertang
authored
nodepool add cam role (#898)
1 parent 2e34eeb commit ab1f812

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

tencentcloud/resource_tc_kubernetes_node_pool.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,12 @@ func composedKubernetesAsScalingConfigPara() map[string]*schema.Schema {
330330
ForceNew: true,
331331
Description: "To specify whether to enable cloud monitor service. Default is TRUE.",
332332
},
333+
"cam_role_name": {
334+
Type: schema.TypeString,
335+
Optional: true,
336+
ForceNew: true,
337+
Description: "Name of cam role.",
338+
},
333339
}
334340

335341
return needSchema
@@ -739,6 +745,9 @@ func composedKubernetesAsScalingConfigParaSerial(dMap map[string]interface{}, me
739745

740746
request.InstanceChargeType = &chargeType
741747

748+
if v, ok := dMap["cam_role_name"]; ok {
749+
request.CamRoleName = helper.String(v.(string))
750+
}
742751
result = request.ToJsonString()
743752
return result, errRet
744753
}
@@ -1012,6 +1021,9 @@ func resourceKubernetesNodePoolRead(d *schema.ResourceData, meta interface{}) er
10121021
if _, ok := d.GetOk("enhanced_monitor_service"); ok || enableMonitor != nil {
10131022
launchConfig["enhanced_monitor_service"] = *enableMonitor
10141023
}
1024+
if _, ok := d.GetOk("cam_role_name"); ok || launchCfg.CamRoleName != nil {
1025+
launchConfig["cam_role_name"] = launchCfg.CamRoleName
1026+
}
10151027
asgConfig := make([]interface{}, 0, 1)
10161028
asgConfig = append(asgConfig, launchConfig)
10171029
if err := d.Set("auto_scaling_config", asgConfig); err != nil {

website/docs/r/kubernetes_node_pool.html.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ The `auto_scaling_config` object supports the following:
182182
* `instance_type` - (Required, ForceNew) Specified types of CVM instance.
183183
* `backup_instance_types` - (Optional) Backup CVM instance types if specified instance type sold out or mismatch.
184184
* `bandwidth_package_id` - (Optional) bandwidth package id. if user is standard user, then the bandwidth_package_id is needed, or default has bandwidth_package_id.
185+
* `cam_role_name` - (Optional, ForceNew) Name of cam role.
185186
* `data_disk` - (Optional) Configurations of data disk.
186187
* `enhanced_monitor_service` - (Optional, ForceNew) To specify whether to enable cloud monitor service. Default is TRUE.
187188
* `enhanced_security_service` - (Optional, ForceNew) To specify whether to enable cloud security service. Default is TRUE.

0 commit comments

Comments
 (0)