title: Terraform GCP - NAT Gateway not creating
body: <p>Using terraform to create nat-gateway using this module.
  <a href="https://registry.terraform.io/modules/GoogleCloudPlatform/nat-gateway/google/1.1.3" rel="nofollow noreferrer">https://registry.terraform.io/modules/GoogleCloudPlatform/nat-gateway/google/1.1.3</a></p>
  
  <p>using this code :</p>
  
  <pre><code>module "nat" {
          source                  = "GoogleCloudPlatform/nat-gateway/google"
          region                  = "${var.gcloud-region}"
          network                 = "${google_compute_network.vpc-network.name}"
          subnetwork              = "${google_compute_subnetwork.vpc-subnetwork-public.name}"
          machine_type    = "${var.vm-type-nat-gateway}"
  }
  </code></pre>
  
  <h1>Other snippets :</h1>
  
  <pre><code>variable "gcloud-region"                        { default = "europe-west1" }
  variable "vm-type-nat-gateway"                  { default = "n1-standard-2"}
  
  resource "google_compute_network" "vpc-network" {
      name                        = "foobar-vpc-network"
      auto_create_subnetworks     = false
  }
  
  
  resource "google_compute_subnetwork" "vpc-subnetwork-public" {
      name                        = "foobar-vpc-subnetwork-public"
      ip_cidr_range               = "10.0.1.0/24"
      network                     = "${google_compute_network.vpc-network.self_link}"
      region                      = "${var.gcloud-region}"
      private_ip_google_access    = false
  }
  </code></pre>
  
  <p>================</p>
  
  <blockquote>
    <ul>
    <li><p>module.nat.google_compute_route.nat-gateway: 1 error(s) occurred:</p></li>
    <li><p>module.nat.google_compute_route.nat-gateway: element: element() may not be used with an empty list in:</p></li>
    </ul>
    
    <p>${element(split("/", element(module.nat-gateway.instances[0], 0)),
    10)}</p>
  </blockquote>
  
  <hr>
  
  <p>Above errror coming up and whole terraform script get stop , and unable to run</p>
  
  <p><code>terraform apply</code> or <code>terraform destroy</code> at any changes,</p>
  
  <p>any possible issue causing this ?</p>