diff --git a/main.tf b/main.tf index 413b5344..59e436df 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] } /******************************************