<p>We can create/see the gcloud command from GKE cluster creation UI , is there a way to convert the command into terraform code for GKE cluster. thanks</p>

Ijaz Ahmad
<p>You can create GKE cluster by using terraform. There is a official <a href="https://www.terraform.io/docs/providers/google/r/container_cluster.html" rel="nofollow noreferrer">link</a>, by following you need to write the .tf file and apply.</p>

<pre><code>resource "google_container_cluster" "primary" {
  name     = "my-gke-cluster"
  location = "us-central1"

  initial_node_count       = 1

  master_auth {
    username = ""
    password = ""

    client_certificate_config {
      issue_client_certificate = false
    }
  }
}
</code></pre>

<p><a href="https://learn.hashicorp.com/terraform/kubernetes/provision-gke-cluster" rel="nofollow noreferrer">This</a> is an useful tutorial.</p>
