<p>I want to create Kubernetes cluster with Terraform,</p>

<p>Regarding the doc page here: <a href="https://www.terraform.io/docs/providers/alicloud/r/cs_managed_kubernetes.html" rel="nofollow noreferrer">https://www.terraform.io/docs/providers/alicloud/r/cs_managed_kubernetes.html</a></p>

<pre><code>variable "name" {
default = "my-first-k8s"
}
data "alicloud_zones" main {
  available_resource_creation = "VSwitch"
}

data "alicloud_instance_types" "default" {
    availability_zone = "${data.alicloud_zones.main.zones.0.id}"
    cpu_core_count = 1
    memory_size = 2
} 
</code></pre>

<p>Where do I insert vswitch id? and how to set the region id?</p>

Fauzan
<p>You can insert the vswitch id in the <code>resource</code> definition:</p>

<pre><code>resource "alicloud_cs_managed_kubernetes" "k8s" {
  name = "${var.name}"
  availability_zone = "${data.alicloud_zones.main.zones.0.id}"
  new_nat_gateway = true
  worker_instance_types = ["${data.alicloud_instance_types.default.instance_types.0.id}"]
  worker_numbers = [2]
  password = "Test12345"
  pod_cidr = "172.20.0.0/16"
  service_cidr = "172.21.0.0/20"
  install_cloud_monitor = true
  worker_disk_category  = "cloud_efficiency"
  vswitch_ids = ["your-alibaba-vswitch-id"]
}
</code></pre>

<p>For the zones (if you want to override the defaults) based on <a href="https://github.com/terraform-providers/terraform-provider-alicloud/blob/master/alicloud/data_source_alicloud_zones.go#L83" rel="nofollow noreferrer">this</a> and the <a href="https://www.terraform.io/docs/providers/alicloud/d/zones.html" rel="nofollow noreferrer">docs</a>, you need to do something like this:</p>

<pre><code>data "alicloud_zones" main {
  available_resource_creation = "VSwitch"

  zones = [
     {
       id = "..."
       local_name = "..."
       ...
     },
     {
       id = "..."
       local_name = "..."
       ...
     },
     ...
  ]
}
</code></pre>
