Skip to content

Commit 13ccaf3

Browse files
committed
Output resource attributes when possible
1 parent 2b6e105 commit 13ccaf3

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

outputs.tf

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
*/
1616

1717
output "network_name" {
18-
value = data.google_compute_network.network.name
18+
value = var.create_network ? google_compute_network.network.name : data.google_compute_network.network.name
1919
description = "The name of the VPC being created"
2020
}
2121

2222
output "network_self_link" {
23-
value = data.google_compute_network.network.self_link
23+
value = var.create_network ? google_compute_network.network.self_link : data.google_compute_network.network.self_link
2424
description = "The URI of the VPC being created"
2525
}
2626

@@ -60,12 +60,11 @@ output "subnets_flow_logs" {
6060
}
6161

6262
output "subnets_secondary_ranges" {
63-
value = data.google_compute_subnetwork.created_subnets.*.secondary_ip_range
63+
value = google_compute_subnetwork.subnetwork[*].secondary_ip_range
6464
description = "The secondary ranges associated with these subnets"
6565
}
6666

6767
output "routes" {
6868
value = google_compute_route.route.*.name
6969
description = "The routes associated with this VPC"
7070
}
71-

0 commit comments

Comments
 (0)