<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><strong>To set region:</strong></p>

<p>While configuring Alicloud provider in Terraform itself you can set the region:</p>

<pre><code>provider "alicloud" {
  access_key = "${var.access_key}"
  secret_key = "${var.secret_key}"
  region     = "${var.region}"
}
</code></pre>

<p>For instance, let me consider <strong>Beijing</strong> as the region:</p>

<pre><code>provider "alicloud" {
      access_key = "accesskey"
      secret_key = "secretkey"
      region     = "cn-beijing"
    }
</code></pre>

<p><strong>To set vswitch IDs:</strong></p>

<p>while defining the <code>resource</code> section we can insert the desired vswitches</p>

<pre><code>resource "alicloud_instance"{
  # ...
  instance_name = "in-the-vpc"
  vswitch_id = "${data.alicloud_vswitches.vswitches_ds.vswitches.0.id}"
  # ...
}
</code></pre>

<p>For instance, let me consider <strong>vsw-25naue4gz</strong> as the vswitch id:</p>

<pre><code>resource "alicloud_instance"{
      # ...
      vswitch_id = "vsw-25naue4gz"
      # ...
    }
</code></pre>
