Skip to content

Commit bc07616

Browse files
authored
Merge pull request #81 from agno01/fix-data-subnets-fetch-depends-on
Add depends_on to created_subnets data fetch
2 parents 9e04cf2 + f933614 commit bc07616

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)