Skip to content

Commit ca6ff49

Browse files
committed
[#26] Add depends_on to created_subnets data fetch
1 parent 86e34bd commit ca6ff49

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

main.tf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,11 @@ resource "google_compute_subnetwork" "subnetwork" {
5252
}
5353

5454
data "google_compute_subnetwork" "created_subnets" {
55-
count = length(var.subnets)
56-
name = element(google_compute_subnetwork.subnetwork.*.name, count.index)
57-
region = element(google_compute_subnetwork.subnetwork.*.region, count.index)
58-
project = var.project_id
55+
count = length(var.subnets)
56+
name = element(google_compute_subnetwork.subnetwork.*.name, count.index)
57+
region = element(google_compute_subnetwork.subnetwork.*.region, count.index)
58+
project = var.project_id
59+
depends_on = ["google_compute_subnetwork.subnetwork"]
5960
}
6061

6162
/******************************************

0 commit comments

Comments
 (0)