terraform-google-modules / terraform-google-cloud-nat

Creates and configures Cloud NAT
https://registry.terraform.io/modules/terraform-google-modules/cloud-nat/google
Apache License 2.0
81 stars 68 forks source link

Cannot determine region. #42

Closed Rishats closed 3 years ago

Rishats commented 3 years ago

Terraform v0.13.3

Error: Cannot determine region: set in this resource, or set provider-level 'region' or 'zone'.

resource "google_compute_router" "router-edge" {
  name    = "router-edge"
  network = google_compute_network.infra-network.self_link
  bgp {
    asn               = 64514
    advertise_mode    = "CUSTOM"
    advertised_groups = ["ALL_SUBNETS"]
    advertised_ip_ranges {
      range = "1.2.3.4"
    }
    advertised_ip_ranges {
      range = "6.7.0.0/16"
    }
  }
}

module "cloud-nat" {
  source     = "terraform-google-modules/cloud-nat/google"
  version    = "~> 1.3"
  project_id = "my-project-id"
  region     = "europe-west3-a"
  router     = google_compute_router.router-edge.self_link
}