Creating gCloud instance with Terraform

main.tf

// Create a new instance
resource "google_compute_instance" "default" {
  name         = "${var.cluster-name}"
  machine_type = "${var.machine-type}"
  zone         = "${var.gcloud-zone}"

  boot_disk {
    initialize_params {
      image = "${var.image}"
    }
  }

  network_interface {
    network = "default"

    access_config {
      // Ephemeral IP
    }
  } 

  service_account {
    scopes = ["https://www.googleapis.com/auth/compute.readonly"]
  }


  metadata {
    sshKeys = "ubuntu:${file("~/.ssh/id_rsa.pub")}"
  }

/*
  provisioner "remote-exec" {
    connection {
      type = "ssh"
      timeout = "2m"
      user = "ubuntu"
      agent = false
    }
    inline = [
      "sudo mkdir /tmp/shawn"
    ]
  }
  */

  metadata_startup_script = <