Add subnets id output, expand net-address outputs

This commit is contained in:
Julio Castillo 2023-06-12 10:21:25 +02:00
parent eddef7e5b6
commit 50d8d4b8b8
4 changed files with 24 additions and 34 deletions

View File

@ -95,9 +95,9 @@ module "addresses" {
| name | description | sensitive |
|---|---|:---:|
| [external_addresses](outputs.tf#L17) | Allocated external addresses. | |
| [global_addresses](outputs.tf#L28) | Allocated global external addresses. | |
| [internal_addresses](outputs.tf#L39) | Allocated internal addresses. | |
| [psa_addresses](outputs.tf#L50) | Allocated internal addresses for PSA endpoints. | |
| [psc_addresses](outputs.tf#L62) | Allocated internal addresses for PSC endpoints. | |
| [global_addresses](outputs.tf#L25) | Allocated global external addresses. | |
| [internal_addresses](outputs.tf#L33) | Allocated internal addresses. | |
| [psa_addresses](outputs.tf#L41) | Allocated internal addresses for PSA endpoints. | |
| [psc_addresses](outputs.tf#L49) | Allocated internal addresses for PSC endpoints. | |
<!-- END TFDOC -->

View File

@ -1,5 +1,5 @@
/**
* Copyright 2022 Google LLC
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -18,10 +18,7 @@ output "external_addresses" {
description = "Allocated external addresses."
value = {
for address in google_compute_address.external :
address.name => {
address = address.address
self_link = address.self_link
}
address.name => address
}
}
@ -29,10 +26,7 @@ output "global_addresses" {
description = "Allocated global external addresses."
value = {
for address in google_compute_global_address.global :
address.name => {
address = address.address
self_link = address.self_link
}
address.name => address
}
}
@ -40,10 +34,7 @@ output "internal_addresses" {
description = "Allocated internal addresses."
value = {
for address in google_compute_address.internal :
address.name => {
address = address.address
self_link = address.self_link
}
address.name => address
}
}
@ -51,11 +42,7 @@ output "psa_addresses" {
description = "Allocated internal addresses for PSA endpoints."
value = {
for address in google_compute_global_address.psa :
address.name => {
address = address.address
prefix_length = address.prefix_length
self_link = address.self_link
}
address.name => address
}
}
@ -63,9 +50,6 @@ output "psc_addresses" {
description = "Allocated internal addresses for PSC endpoints."
value = {
for address in google_compute_global_address.psc :
address.name => {
address = address.address
self_link = address.self_link
}
address.name => address
}
}

View File

@ -512,12 +512,13 @@ module "vpc" {
| [network](outputs.tf#L46) | Network resource. | |
| [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_ips](outputs.tf#L83) | Map of subnet address ranges keyed by name. | |
| [subnet_regions](outputs.tf#L90) | Map of subnet regions keyed by name. | |
| [subnet_secondary_ranges](outputs.tf#L97) | Map of subnet secondary ranges keyed by name. | |
| [subnet_self_links](outputs.tf#L108) | Map of subnet self links keyed by name. | |
| [subnets](outputs.tf#L113) | Subnet resources. | |
| [subnets_proxy_only](outputs.tf#L118) | L7 ILB or L7 Regional LB subnet resources. | |
| [subnets_psc](outputs.tf#L123) | Private Service Connect subnet resources. | |
| [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_regions](outputs.tf#L95) | Map of subnet regions keyed by name. | |
| [subnet_secondary_ranges](outputs.tf#L102) | Map of subnet secondary ranges keyed by name. | |
| [subnet_self_links](outputs.tf#L113) | Map of subnet self links keyed by name. | |
| [subnets](outputs.tf#L118) | Subnet resources. | |
| [subnets_proxy_only](outputs.tf#L123) | L7 ILB or L7 Regional LB subnet resources. | |
| [subnets_psc](outputs.tf#L128) | Private Service Connect subnet resources. | |
<!-- END TFDOC -->

View File

@ -1,5 +1,5 @@
/**
* Copyright 2022 Google LLC
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -80,6 +80,11 @@ 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 }
}
output "subnet_ips" {
description = "Map of subnet address ranges keyed by name."
value = {