Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion tencentcloud/resource_tc_kubernetes_node_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,16 @@ func ResourceTencentCloudKubernetesNodePool() *schema.Resource {
Computed: true,
Description: "The total node count.",
},
"autoscaling_added_total": {
Type: schema.TypeInt,
Computed: true,
Description: "The total of autoscaling added node.",
},
"manually_added_total": {
Type: schema.TypeInt,
Computed: true,
Description: "The total of manually added node.",
},
"launch_config_id": {
Type: schema.TypeString,
Computed: true,
Expand Down Expand Up @@ -927,7 +937,11 @@ func resourceKubernetesNodePoolRead(d *schema.ResourceData, meta interface{}) er

_ = d.Set("name", nodePool.Name)
_ = d.Set("status", nodePool.LifeState)
_ = d.Set("node_count", nodePool.NodeCountSummary)
AutoscalingAddedTotal := *nodePool.NodeCountSummary.AutoscalingAdded.Total
ManuallyAddedTotal := *nodePool.NodeCountSummary.ManuallyAdded.Total
_ = d.Set("autoscaling_added_total", AutoscalingAddedTotal)
_ = d.Set("manually_added_total", ManuallyAddedTotal)
_ = d.Set("node_count", AutoscalingAddedTotal+ManuallyAddedTotal)
_ = d.Set("auto_scaling_group_id", nodePool.AutoscalingGroupId)
_ = d.Set("launch_config_id", nodePool.LaunchConfigurationId)
//set not force new parameters
Expand Down
4 changes: 4 additions & 0 deletions tencentcloud/resource_tc_kubernetes_node_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ func TestAccTencentCloudTkeNodePoolResource(t *testing.T) {
resource.TestCheckResourceAttr(testTkeClusterNodePoolResourceKey, "default_cooldown", "400"),
resource.TestCheckResourceAttr(testTkeClusterNodePoolResourceKey, "termination_policies.#", "1"),
resource.TestCheckResourceAttr(testTkeClusterNodePoolResourceKey, "termination_policies.0", "OLDEST_INSTANCE"),
resource.TestCheckResourceAttr(testTkeClusterNodePoolResourceKey, "node_count", "1"),
resource.TestCheckResourceAttr(testTkeClusterNodePoolResourceKey, "autoscaling_added_total", "1"),
resource.TestCheckResourceAttr(testTkeClusterNodePoolResourceKey, "manually_added_total", "0"),
),
},
{
Expand Down Expand Up @@ -270,6 +273,7 @@ resource "tencentcloud_kubernetes_node_pool" "np_test" {
"root-dir=/var/lib/kubelet"
]
}
node_os="Tencent tlinux release 2.2 (Final)"
}
`

Expand Down
2 changes: 2 additions & 0 deletions website/docs/r/kubernetes_node_pool.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,9 @@ In addition to all arguments above, the following attributes are exported:

* `id` - ID of the resource.
* `auto_scaling_group_id` - The auto scaling group ID.
* `autoscaling_added_total` - The total of autoscaling added node.
* `launch_config_id` - The launch config ID.
* `manually_added_total` - The total of manually added node.
* `node_count` - The total node count.
* `status` - Status of the node pool.

Expand Down