From 509b715a092049722bb96a05ab36268503417463 Mon Sep 17 00:00:00 2001 From: Simone Ruffilli Date: Thu, 16 Oct 2025 09:44:33 +0200 Subject: [PATCH] Adds network_id to net-vpc outputs (#3421) * Adds network_id to net-vpc outputs * Fixes description --- modules/net-vpc/README.md | 25 +++++++++++++------------ modules/net-vpc/outputs.tf | 12 ++++++++++++ 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/modules/net-vpc/README.md b/modules/net-vpc/README.md index af95ac727..805746e0a 100644 --- a/modules/net-vpc/README.md +++ b/modules/net-vpc/README.md @@ -938,16 +938,17 @@ secondary_ip_ranges: | [name](outputs.tf#L51) | Network name. | | | [network](outputs.tf#L63) | Network resource. | | | [network_attachment_ids](outputs.tf#L75) | IDs of network attachments. | | -| [project_id](outputs.tf#L83) | Project ID containing the network. Use this when you need to create resources *after* the VPC is fully set up (e.g. subnets created, shared VPC service projects attached, Private Service Networking configured). | | -| [self_link](outputs.tf#L96) | Network self link. | | -| [subnet_ids](outputs.tf#L108) | Map of subnet IDs keyed by name. | | -| [subnet_ips](outputs.tf#L117) | Map of subnet address ranges keyed by name. | | -| [subnet_ipv6_external_prefixes](outputs.tf#L124) | Map of subnet external IPv6 prefixes keyed by name. | | -| [subnet_regions](outputs.tf#L132) | Map of subnet regions keyed by name. | | -| [subnet_secondary_ranges](outputs.tf#L139) | Map of subnet secondary ranges keyed by name. | | -| [subnet_self_links](outputs.tf#L150) | Map of subnet self links keyed by name. | | -| [subnets](outputs.tf#L159) | Subnet resources. | | -| [subnets_private_nat](outputs.tf#L168) | Private NAT subnet resources. | | -| [subnets_proxy_only](outputs.tf#L173) | L7 ILB or L7 Regional LB subnet resources. | | -| [subnets_psc](outputs.tf#L178) | Private Service Connect subnet resources. | | +| [network_id](outputs.tf#L83) | Numeric network id. | | +| [project_id](outputs.tf#L95) | Project ID containing the network. Use this when you need to create resources *after* the VPC is fully set up (e.g. subnets created, shared VPC service projects attached, Private Service Networking configured). | | +| [self_link](outputs.tf#L108) | Network self link. | | +| [subnet_ids](outputs.tf#L120) | Map of subnet IDs keyed by name. | | +| [subnet_ips](outputs.tf#L129) | Map of subnet address ranges keyed by name. | | +| [subnet_ipv6_external_prefixes](outputs.tf#L136) | Map of subnet external IPv6 prefixes keyed by name. | | +| [subnet_regions](outputs.tf#L144) | Map of subnet regions keyed by name. | | +| [subnet_secondary_ranges](outputs.tf#L151) | Map of subnet secondary ranges keyed by name. | | +| [subnet_self_links](outputs.tf#L162) | Map of subnet self links keyed by name. | | +| [subnets](outputs.tf#L171) | Subnet resources. | | +| [subnets_private_nat](outputs.tf#L180) | Private NAT subnet resources. | | +| [subnets_proxy_only](outputs.tf#L185) | L7 ILB or L7 Regional LB subnet resources. | | +| [subnets_psc](outputs.tf#L190) | Private Service Connect subnet resources. | | diff --git a/modules/net-vpc/outputs.tf b/modules/net-vpc/outputs.tf index 1e162ffb7..29213238a 100644 --- a/modules/net-vpc/outputs.tf +++ b/modules/net-vpc/outputs.tf @@ -80,6 +80,18 @@ output "network_attachment_ids" { } } +output "network_id" { + description = "Numeric network id." + value = local.network.network_id + depends_on = [ + google_compute_network_peering.local, + google_compute_network_peering.remote, + google_compute_shared_vpc_host_project.shared_vpc_host, + google_compute_shared_vpc_service_project.service_projects, + google_service_networking_connection.psa_connection + ] +} + output "project_id" { description = "Project ID containing the network. Use this when you need to create resources *after* the VPC is fully set up (e.g. subnets created, shared VPC service projects attached, Private Service Networking configured)." value = var.project_id