@@ -43,10 +43,6 @@ resource "tencentcloud_kubernetes_cluster" "managed_cluster" {
4343 cluster_internet = true
4444 managed_cluster_internet_security_policies = ["3.3.3.3", "1.1.1.1"]
4545 cluster_deploy_type = "MANAGED_CLUSTER"
46- data_disk {
47- disk_type = "CLOUD_PREMIUM"
48- disk_size = 50
49- }
5046
5147 worker_config {
5248 count = 1
@@ -267,6 +263,62 @@ resource "tencentcloud_kubernetes_cluster" "test_node_pool_global_config" {
267263 }
268264}
269265```
266+
267+ Using VPC-CNI network type
268+ ```hcl
269+ variable "availability_zone" {
270+ default = "ap-guangzhou-1"
271+ }
272+
273+ variable "vpc" {
274+ default = "vpc-r1m1fyx5"
275+ }
276+
277+ variable "default_instance_type" {
278+ default = "SA2.SMALL2"
279+ }
280+
281+ resource "tencentcloud_kubernetes_cluster" "managed_cluster" {
282+ vpc_id = var.vpc
283+ cluster_max_pod_num = 32
284+ cluster_name = "test"
285+ cluster_desc = "test cluster desc"
286+ cluster_max_service_num = 256
287+ cluster_internet = true
288+ managed_cluster_internet_security_policies = ["3.3.3.3", "1.1.1.1"]
289+ cluster_deploy_type = "MANAGED_CLUSTER"
290+ network_type = "VPC-CNI"
291+ eni_subnet_ids = ["subnet-bk1etlyu"]
292+ service_cidr = "10.1.0.0/24"
293+
294+ worker_config {
295+ count = 1
296+ availability_zone = var.availability_zone
297+ instance_type = var.default_instance_type
298+ system_disk_type = "CLOUD_PREMIUM"
299+ system_disk_size = 60
300+ internet_charge_type = "TRAFFIC_POSTPAID_BY_HOUR"
301+ internet_max_bandwidth_out = 100
302+ public_ip_assigned = true
303+ subnet_id = "subnet-t5dv27rs"
304+
305+ data_disk {
306+ disk_type = "CLOUD_PREMIUM"
307+ disk_size = 50
308+ }
309+
310+ enhanced_security_service = false
311+ enhanced_monitor_service = false
312+ user_data = "dGVzdA=="
313+ password = "ZZXXccvv1212"
314+ }
315+
316+ labels = {
317+ "test1" = "test1",
318+ "test2" = "test2",
319+ }
320+ }
321+ ```
270322*/
271323package tencentcloud
272324
@@ -474,7 +526,7 @@ func TkeCvmCreateInfo() map[string]*schema.Schema {
474526 Type : schema .TypeBool ,
475527 ForceNew : true ,
476528 Optional : true ,
477- Default : true ,
529+ Default : false ,
478530 Description : "Indicate whether to auto format and mount or not. Default is `false`." ,
479531 },
480532 "mount_target" : {
@@ -483,6 +535,12 @@ func TkeCvmCreateInfo() map[string]*schema.Schema {
483535 Optional : true ,
484536 Description : "Mount target." ,
485537 },
538+ "disk_partition" : {
539+ Type : schema .TypeString ,
540+ ForceNew : true ,
541+ Optional : true ,
542+ Description : "The name of the device or partition to mount." ,
543+ },
486544 },
487545 },
488546 },
@@ -1739,6 +1797,7 @@ func resourceTencentCloudTkeClusterCreate(d *schema.ResourceData, meta interface
17391797 fileSystem = disk ["file_system" ].(string )
17401798 autoFormatAndMount = disk ["auto_format_and_mount" ].(bool )
17411799 mountTarget = disk ["mount_target" ].(string )
1800+ diskPartition = disk ["disk_partition" ].(string )
17421801 )
17431802
17441803 dataDisk := & tke.DataDisk {
@@ -1750,10 +1809,15 @@ func resourceTencentCloudTkeClusterCreate(d *schema.ResourceData, meta interface
17501809 if fileSystem != "" {
17511810 dataDisk .FileSystem = & fileSystem
17521811 }
1812+
17531813 if mountTarget != "" {
17541814 dataDisk .MountTarget = & mountTarget
17551815 }
17561816
1817+ if diskPartition != "" {
1818+ dataDisk .DiskPartition = & diskPartition
1819+ }
1820+
17571821 iDiskMountSetting .DataDisks = append (iDiskMountSetting .DataDisks , dataDisk )
17581822 }
17591823
0 commit comments