Skip to content

Commit

Permalink
Revert "reverted changes for network argument"
Browse files Browse the repository at this point in the history
This reverts commit a601f10.
  • Loading branch information
Tfmenard committed Jun 17, 2019
1 parent 214b70f commit ffa3bfd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions examples/simple_example/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
}
4 changes: 2 additions & 2 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

Expand Down

0 comments on commit ffa3bfd

Please sign in to comment.