Skip to content

Commit

Permalink
Better way to access networks
Browse files Browse the repository at this point in the history
Use data resource rather than path formatting
  • Loading branch information
pratikmallya committed Sep 26, 2018
1 parent 85bb002 commit 0abe6df
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cluster_regional.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ resource "google_container_cluster" "primary" {
region = "${var.region}"
additional_zones = "${var.zones}"

network = "projects/${local.network_project_id}/global/networks/${var.network}"
subnetwork = "projects/${local.network_project_id}/regions/${var.region}/subnetworks/${var.subnetwork}"
network = "${data.google_compute_network.gke_network.self_link}"
subnetwork = "${data.google_compute_subnetwork.gke_subnetwork.self_link}"
min_master_version = "${local.kubernetes_version}"

logging_service = "${var.logging_service}"
Expand Down
4 changes: 2 additions & 2 deletions cluster_zonal.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ resource "google_container_cluster" "zonal_primary" {
zone = "${var.zones[0]}"
additional_zones = "${slice(var.zones,1,length(var.zones))}"

network = "projects/${local.network_project_id}/global/networks/${var.network}"
subnetwork = "projects/${local.network_project_id}/regions/${var.region}/subnetworks/${var.subnetwork}"
network = "${data.google_compute_network.gke_network.self_link}"
subnetwork = "${data.google_compute_subnetwork.gke_subnetwork.self_link}"
min_master_version = "${local.kubernetes_version}"

logging_service = "${var.logging_service}"
Expand Down

0 comments on commit 0abe6df

Please sign in to comment.