From ca6ff493de647b957dd4cf7706c0ecafc97753c8 Mon Sep 17 00:00:00 2001 From: Andrej Golis Date: Thu, 10 Oct 2019 19:17:16 +0200 Subject: [PATCH 1/2] [#26] Add depends_on to created_subnets data fetch --- main.tf | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/main.tf b/main.tf index 413b5344..8837f500 100644 --- a/main.tf +++ b/main.tf @@ -52,10 +52,11 @@ resource "google_compute_subnetwork" "subnetwork" { } data "google_compute_subnetwork" "created_subnets" { - count = length(var.subnets) - name = element(google_compute_subnetwork.subnetwork.*.name, count.index) - region = element(google_compute_subnetwork.subnetwork.*.region, count.index) - project = var.project_id + count = length(var.subnets) + name = element(google_compute_subnetwork.subnetwork.*.name, count.index) + region = element(google_compute_subnetwork.subnetwork.*.region, count.index) + project = var.project_id + depends_on = ["google_compute_subnetwork.subnetwork"] } /****************************************** From f933614fd3799bf49a6309d0163a98ec32d10b96 Mon Sep 17 00:00:00 2001 From: Andrej Golis Date: Thu, 10 Oct 2019 19:53:35 +0200 Subject: [PATCH 2/2] remove quotes Co-Authored-By: Morgante Pell --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 8837f500..59e436df 100644 --- a/main.tf +++ b/main.tf @@ -56,7 +56,7 @@ data "google_compute_subnetwork" "created_subnets" { name = element(google_compute_subnetwork.subnetwork.*.name, count.index) region = element(google_compute_subnetwork.subnetwork.*.region, count.index) project = var.project_id - depends_on = ["google_compute_subnetwork.subnetwork"] + depends_on = [google_compute_subnetwork.subnetwork] } /******************************************