From ffa3bfde26b32a78d8a98ccf6f1880e6e059e90a Mon Sep 17 00:00:00 2001 From: tfmenard Date: Mon, 17 Jun 2019 17:44:51 -0500 Subject: [PATCH] Revert "reverted changes for network argument" This reverts commit a601f1099d405a315560493b7cf39a0a809283e2. --- examples/simple_example/main.tf | 4 ++-- main.tf | 2 +- variables.tf | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/simple_example/main.tf b/examples/simple_example/main.tf index 20611a9..539cb6e 100644 --- a/examples/simple_example/main.tf +++ b/examples/simple_example/main.tf @@ -67,7 +67,7 @@ module "dataflow-job" { template_gcs_path = "gs://dataflow-templates/latest/Word_Count" temp_gcs_location = "${module.dataflow-bucket.name}" service_account_email = "${var.service_account_email}" - network_name = "${module.vpc.network_name}" + network_self_link = "${module.vpc.network_self_link}" subnetwork_self_link = "${module.vpc.subnets_self_links[0]}" machine_type = "n1-standard-1" @@ -87,7 +87,7 @@ module "dataflow-job-2" { template_gcs_path = "gs://dataflow-templates/latest/Word_Count" temp_gcs_location = "${module.dataflow-bucket.name}" service_account_email = "${var.service_account_email}" - network_name = "${module.vpc.network_name}" + network_self_link = "${module.vpc.network_self_link}" subnetwork_self_link = "${module.vpc.subnets_self_links[0]}" machine_type = "n1-standard-2" diff --git a/main.tf b/main.tf index dc9d6f1..84eb0c7 100644 --- a/main.tf +++ b/main.tf @@ -25,7 +25,7 @@ resource "google_dataflow_job" "dataflow_job" { temp_gcs_location = "gs://${var.temp_gcs_location}/tmp_dir" parameters = "${var.parameters}" service_account_email = "${var.service_account_email}" - network = "${var.network_name}" + network = "${replace(var.network_self_link, "/(.*)/networks/(.*)/", "$2")}" subnetwork = "${replace(var.subnetwork_self_link, "/(.*)/regions/(.*)/", "regions/$2")}" machine_type = "${var.machine_type}" } diff --git a/variables.tf b/variables.tf index 612aaee..046572b 100644 --- a/variables.tf +++ b/variables.tf @@ -64,8 +64,8 @@ variable "subnetwork_self_link" { default = "" } -variable "network_name" { - description = "The name of the network to which VMs will be assigned." +variable "network_self_link" { + description = "The network self link to which VMs will be assigned." default = "default" }