Make subnets depend on proxy only subnets (#1762)

* Make subnets depend on proxy only subnets

* Add dependency to subnet_ids too

* Update readme
This commit is contained in:
Julio Castillo 2023-10-16 13:39:52 +02:00 committed by GitHub
parent f464557525
commit 82f14fd6c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 9 deletions

View File

@ -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. | |
<!-- END TFDOC -->

View File

@ -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 }
}
}