diff --git a/modules/net-address/README.md b/modules/net-address/README.md
index 5ff4f20e2..c91d0e02e 100644
--- a/modules/net-address/README.md
+++ b/modules/net-address/README.md
@@ -136,13 +136,13 @@ module "addresses" {
| name | description | type | required | default |
|---|---|:---:|:---:|:---:|
-| [project_id](variables.tf#L83) | Project where the addresses will be created. | string | ✓ | |
-| [external_addresses](variables.tf#L17) | Map of external addresses, keyed by name. | map(object({…})) | | {} |
-| [global_addresses](variables.tf#L39) | List of global addresses to create. | map(object({…})) | | {} |
-| [internal_addresses](variables.tf#L49) | Map of internal addresses to create, keyed by name. | map(object({…})) | | {} |
-| [ipsec_interconnect_addresses](variables.tf#L64) | Map of internal addresses used for HPA VPN over Cloud Interconnect. | map(object({…})) | | {} |
-| [psa_addresses](variables.tf#L88) | Map of internal addresses used for Private Service Access. | map(object({…})) | | {} |
-| [psc_addresses](variables.tf#L101) | Map of internal addresses used for Private Service Connect. | map(object({…})) | | {} |
+| [project_id](variables.tf#L84) | Project where the addresses will be created. | string | ✓ | |
+| [external_addresses](variables.tf#L17) | Map of external addresses, keyed by name. | map(object({…})) | | {} |
+| [global_addresses](variables.tf#L40) | List of global addresses to create. | map(object({…})) | | {} |
+| [internal_addresses](variables.tf#L50) | Map of internal addresses to create, keyed by name. | map(object({…})) | | {} |
+| [ipsec_interconnect_addresses](variables.tf#L65) | Map of internal addresses used for HPA VPN over Cloud Interconnect. | map(object({…})) | | {} |
+| [psa_addresses](variables.tf#L89) | Map of internal addresses used for Private Service Access. | map(object({…})) | | {} |
+| [psc_addresses](variables.tf#L102) | Map of internal addresses used for Private Service Connect. | map(object({…})) | | {} |
## Outputs
diff --git a/modules/net-address/main.tf b/modules/net-address/main.tf
index 890d9462a..11cf7d3cd 100644
--- a/modules/net-address/main.tf
+++ b/modules/net-address/main.tf
@@ -27,13 +27,14 @@ resource "google_compute_address" "external" {
for_each = var.external_addresses
project = var.project_id
name = coalesce(each.value.name, each.key)
- description = each.value.description
address_type = "EXTERNAL"
+ description = each.value.description
ip_version = each.value.ipv6 != null ? "IPV6" : "IPV4"
ipv6_endpoint_type = try(each.value.ipv6.endpoint_type, null)
+ labels = each.value.labels
network_tier = each.value.tier
region = each.value.region
- labels = each.value.labels
+ subnetwork = each.value.subnetwork
}
resource "google_compute_address" "internal" {
@@ -41,14 +42,14 @@ resource "google_compute_address" "internal" {
for_each = var.internal_addresses
project = var.project_id
name = coalesce(each.value.name, each.key)
- description = each.value.description
+ address = each.value.address
address_type = "INTERNAL"
+ description = each.value.description
+ ip_version = each.value.ipv6 != null ? "IPV6" : "IPV4"
+ labels = coalesce(each.value.labels, {})
+ purpose = each.value.purpose
region = each.value.region
subnetwork = each.value.subnetwork
- address = each.value.address
- ip_version = each.value.ipv6 != null ? "IPV6" : "IPV4"
- purpose = each.value.purpose
- labels = coalesce(each.value.labels, {})
}
resource "google_compute_global_address" "psc" {
diff --git a/modules/net-address/variables.tf b/modules/net-address/variables.tf
index 3f91f0a5f..af2bc4b83 100644
--- a/modules/net-address/variables.tf
+++ b/modules/net-address/variables.tf
@@ -22,9 +22,10 @@ variable "external_addresses" {
ipv6 = optional(object({
endpoint_type = string
}))
- labels = optional(map(string), {})
- name = optional(string)
- tier = optional(string)
+ labels = optional(map(string), {})
+ name = optional(string)
+ subnetwork = optional(string) # for IPv6
+ tier = optional(string)
}))
default = {}
validation {