Skip to content

Commit 436ece7

Browse files
authored
feat(tke): [116732448]Field cluster_subnet_id supports ForceNew (#2578)
* Field cluster_subnet_id supports ForceNew * add changelog 2578.txt
1 parent 64a15b2 commit 436ece7

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

.changelog/2578.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
resource/tencentcloud_kubernetes_cluster: Field `cluster_subnet_id` supports ForceNew
3+
```

tencentcloud/services/tke/resource_tc_kubernetes_cluster.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,7 @@ func ResourceTencentCloudTkeCluster() *schema.Resource {
474474
"cluster_subnet_id": {
475475
Type: schema.TypeString,
476476
Optional: true,
477+
ForceNew: true,
477478
Description: "Subnet ID of the cluster, such as: subnet-b3p7d7q5.",
478479
},
479480

@@ -2494,10 +2495,6 @@ func resourceTencentCloudTkeClusterUpdate(d *schema.ResourceData, meta interface
24942495
region := client.Region
24952496
d.Partial(true)
24962497

2497-
if d.HasChange("cluster_subnet_id") {
2498-
return fmt.Errorf("argument cluster_subnet_id cannot be changed")
2499-
}
2500-
25012498
if d.HasChange("tags") {
25022499
oldTags, newTags := d.GetChange("tags")
25032500
replaceTags, deleteTags := svctag.DiffTags(oldTags.(map[string]interface{}), newTags.(map[string]interface{}))

website/docs/r/kubernetes_cluster.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ The following arguments are supported:
817817
* `cluster_name` - (Optional, String) Name of the cluster.
818818
* `cluster_os_type` - (Optional, String, ForceNew) Image type of the cluster os, the available values include: 'GENERAL'. Default is 'GENERAL'.
819819
* `cluster_os` - (Optional, String, ForceNew) Operating system of the cluster, the available values include: 'centos7.6.0_x64','ubuntu18.04.1x86_64','tlinux2.4x86_64'. Default is 'tlinux2.4x86_64'.
820-
* `cluster_subnet_id` - (Optional, String) Subnet ID of the cluster, such as: subnet-b3p7d7q5.
820+
* `cluster_subnet_id` - (Optional, String, ForceNew) Subnet ID of the cluster, such as: subnet-b3p7d7q5.
821821
* `cluster_version` - (Optional, String) Version of the cluster. Use `tencentcloud_kubernetes_available_cluster_versions` to get the upgradable cluster version.
822822
* `container_runtime` - (Optional, String, ForceNew) Runtime type of the cluster, the available values include: 'docker' and 'containerd'.The Kubernetes v1.24 has removed dockershim, so please use containerd in v1.24 or higher.Default is 'docker'.
823823
* `deletion_protection` - (Optional, Bool) Indicates whether cluster deletion protection is enabled. Default is false.

0 commit comments

Comments
 (0)