From 82f14fd6c0d10c816880a128eae192fde2e7b1eb Mon Sep 17 00:00:00 2001 From: Julio Castillo Date: Mon, 16 Oct 2023 13:39:52 +0200 Subject: [PATCH] Make subnets depend on proxy only subnets (#1762) * Make subnets depend on proxy only subnets * Add dependency to subnet_ids too * Update readme --- modules/net-vpc/README.md | 16 ++++++++-------- modules/net-vpc/outputs.tf | 14 +++++++++++++- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/modules/net-vpc/README.md b/modules/net-vpc/README.md index e3cc75fd..e171125b 100644 --- a/modules/net-vpc/README.md +++ b/modules/net-vpc/README.md @@ -571,12 +571,12 @@ module "vpc" { | [project_id](outputs.tf#L58) | 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#L71) | Network self link. | | | [subnet_ids](outputs.tf#L83) | Map of subnet IDs keyed by name. | | -| [subnet_ips](outputs.tf#L88) | Map of subnet address ranges keyed by name. | | -| [subnet_ipv6_external_prefixes](outputs.tf#L95) | Map of subnet external IPv6 prefixes keyed by name. | | -| [subnet_regions](outputs.tf#L103) | Map of subnet regions keyed by name. | | -| [subnet_secondary_ranges](outputs.tf#L110) | Map of subnet secondary ranges keyed by name. | | -| [subnet_self_links](outputs.tf#L121) | Map of subnet self links keyed by name. | | -| [subnets](outputs.tf#L126) | Subnet resources. | | -| [subnets_proxy_only](outputs.tf#L131) | L7 ILB or L7 Regional LB subnet resources. | | -| [subnets_psc](outputs.tf#L136) | Private Service Connect subnet resources. | | +| [subnet_ips](outputs.tf#L92) | Map of subnet address ranges keyed by name. | | +| [subnet_ipv6_external_prefixes](outputs.tf#L99) | Map of subnet external IPv6 prefixes keyed by name. | | +| [subnet_regions](outputs.tf#L107) | Map of subnet regions keyed by name. | | +| [subnet_secondary_ranges](outputs.tf#L114) | Map of subnet secondary ranges keyed by name. | | +| [subnet_self_links](outputs.tf#L125) | Map of subnet self links keyed by name. | | +| [subnets](outputs.tf#L134) | Subnet resources. | | +| [subnets_proxy_only](outputs.tf#L143) | L7 ILB or L7 Regional LB subnet resources. | | +| [subnets_psc](outputs.tf#L148) | Private Service Connect subnet resources. | | diff --git a/modules/net-vpc/outputs.tf b/modules/net-vpc/outputs.tf index 503923d9..d0bb139f 100644 --- a/modules/net-vpc/outputs.tf +++ b/modules/net-vpc/outputs.tf @@ -83,6 +83,10 @@ output "self_link" { output "subnet_ids" { description = "Map of subnet IDs keyed by name." value = { for k, v in google_compute_subnetwork.subnetwork : k => v.id } + depends_on = [ + # allows correct destruction of internal application load balancers + google_compute_subnetwork.proxy_only + ] } output "subnet_ips" { @@ -121,11 +125,19 @@ output "subnet_secondary_ranges" { output "subnet_self_links" { description = "Map of subnet self links keyed by name." value = { for k, v in google_compute_subnetwork.subnetwork : k => v.self_link } + depends_on = [ + # allows correct destruction of internal application load balancers + google_compute_subnetwork.proxy_only + ] } output "subnets" { description = "Subnet resources." value = { for k, v in google_compute_subnetwork.subnetwork : k => v } + depends_on = [ + # allows correct destruction of internal application load balancers + google_compute_subnetwork.proxy_only + ] } output "subnets_proxy_only" { @@ -136,4 +148,4 @@ output "subnets_proxy_only" { output "subnets_psc" { description = "Private Service Connect subnet resources." value = { for k, v in google_compute_subnetwork.psc : k => v } -} \ No newline at end of file +}