From af23304bd75acdc8969438c14604f11e84cd3f36 Mon Sep 17 00:00:00 2001 From: Gerrit DeWitt Date: Fri, 18 Jul 2025 11:24:26 -0700 Subject: [PATCH 1/5] Include zero_advertised_route_priority attribute for each BGP peer Include zero_advertised_route_priority attribute for each BGP peer, just like we do in the interface module. --- modules/interconnect_attachment/metadata.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/interconnect_attachment/metadata.yaml b/modules/interconnect_attachment/metadata.yaml index 2086397..4cc5f63 100644 --- a/modules/interconnect_attachment/metadata.yaml +++ b/modules/interconnect_attachment/metadata.yaml @@ -109,9 +109,10 @@ spec: description: BGP Peer for this attachment. varType: |- object({ - name = string - peer_asn = string - advertised_route_priority = optional(number) + name = string + peer_asn = string + advertised_route_priority = optional(number) + zero_advertised_route_priority = optional(bool) bfd = optional(object({ session_initialization_mode = string min_transmit_interval = optional(number) From 7d023e2946f96aeae58e13bc1cabb7ee138a2446 Mon Sep 17 00:00:00 2001 From: Gerrit DeWitt Date: Fri, 18 Jul 2025 11:26:25 -0700 Subject: [PATCH 2/5] Add zero_advertised_route_priority attribute to the peer variable Add zero_advertised_route_priority attribute to the peer variable to match what we do for the peer variable in the interface module. --- modules/interconnect_attachment/variables.tf | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/interconnect_attachment/variables.tf b/modules/interconnect_attachment/variables.tf index 269e224..d737809 100644 --- a/modules/interconnect_attachment/variables.tf +++ b/modules/interconnect_attachment/variables.tf @@ -117,9 +117,10 @@ variable "interface" { variable "peer" { description = "BGP Peer for this attachment." type = object({ - name = string - peer_asn = string - advertised_route_priority = optional(number) + name = string + peer_asn = string + advertised_route_priority = optional(number) + zero_advertised_route_priority = optional(bool) bfd = optional(object({ session_initialization_mode = string min_transmit_interval = optional(number) From 2d5a6e15b132709543c4f8d6134921fbafaedfd8 Mon Sep 17 00:00:00 2001 From: Gerrit DeWitt Date: Fri, 18 Jul 2025 11:30:48 -0700 Subject: [PATCH 3/5] Declare zero_advertised_route_priority for each peer in the peers list in the interface module Declare zero_advertised_route_priority for each peer in the peers list in the interface module. The interface module passes the value of zero_advertised_route_priority to zero_advertised_route_priority in each google_compute_router_peer resource. --- modules/interconnect_attachment/main.tf | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/interconnect_attachment/main.tf b/modules/interconnect_attachment/main.tf index 77fe6f9..bf9f304 100644 --- a/modules/interconnect_attachment/main.tf +++ b/modules/interconnect_attachment/main.tf @@ -46,9 +46,10 @@ module "interface" { name = try(var.peer.name, null) # Peer IP Address must not contain the subnet mask, else will throw an invalid IP address error. - peer_ip_address = element(split("/", google_compute_interconnect_attachment.attachment.customer_router_ip_address), 0) - peer_asn = try(var.peer.peer_asn, null) - advertised_route_priority = try(var.peer.advertised_route_priority, null) + peer_ip_address = element(split("/", google_compute_interconnect_attachment.attachment.customer_router_ip_address), 0) + peer_asn = try(var.peer.peer_asn, null) + advertised_route_priority = try(var.peer.advertised_route_priority, null) + zero_advertised_route_priority = try(var.peer.zero_advertised_route_priority, false) bfd = try(var.peer.bfd, null) md5_authentication_key = try(var.peer.md5_authentication_key, null) }] From 855b340696df43a571e0b312bb716881f3ad4590 Mon Sep 17 00:00:00 2001 From: Gerrit DeWitt Date: Tue, 5 Aug 2025 03:02:17 +0000 Subject: [PATCH 4/5] docs --- modules/interconnect_attachment/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/interconnect_attachment/README.md b/modules/interconnect_attachment/README.md index db2f92d..9c97aac 100644 --- a/modules/interconnect_attachment/README.md +++ b/modules/interconnect_attachment/README.md @@ -17,7 +17,7 @@ | ipsec\_internal\_addresses | URL of addresses that have been reserved for the interconnect attachment, Used only for interconnect attachment that has the encryption option as IPSEC. | `list(string)` | `[]` | no | | mtu | Maximum Transmission Unit (MTU), in bytes, of packets passing through this interconnect attachment. Currently, only 1440 and 1500 are allowed. If not specified, the value will default to 1440. | `string` | `null` | no | | name | The name of the interconnect attachment | `string` | n/a | yes | -| peer | BGP Peer for this attachment. |
object({
name = string
peer_asn = string
advertised_route_priority = optional(number)
bfd = optional(object({
session_initialization_mode = string
min_transmit_interval = optional(number)
min_receive_interval = optional(number)
multiplier = optional(number)
}))
md5_authentication_key = optional(object({
name = string
key = string
}))
})
| `null` | no | +| peer | BGP Peer for this attachment. |
object({
name = string
peer_asn = string
advertised_route_priority = optional(number)
zero_advertised_route_priority = optional(bool)
bfd = optional(object({
session_initialization_mode = string
min_transmit_interval = optional(number)
min_receive_interval = optional(number)
multiplier = optional(number)
}))
md5_authentication_key = optional(object({
name = string
key = string
}))
})
| `null` | no | | project | The project ID to deploy to | `string` | n/a | yes | | region | Region where the attachment resides | `string` | n/a | yes | | router | Name of the router the attachment resides | `string` | n/a | yes | From 4277c0cf1f12f302db5b71711209d2a2caf918e9 Mon Sep 17 00:00:00 2001 From: Gerrit DeWitt Date: Tue, 5 Aug 2025 03:09:17 +0000 Subject: [PATCH 5/5] docs --- modules/interconnect_attachment/main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/interconnect_attachment/main.tf b/modules/interconnect_attachment/main.tf index bf9f304..1c151f4 100644 --- a/modules/interconnect_attachment/main.tf +++ b/modules/interconnect_attachment/main.tf @@ -50,8 +50,8 @@ module "interface" { peer_asn = try(var.peer.peer_asn, null) advertised_route_priority = try(var.peer.advertised_route_priority, null) zero_advertised_route_priority = try(var.peer.zero_advertised_route_priority, false) - bfd = try(var.peer.bfd, null) - md5_authentication_key = try(var.peer.md5_authentication_key, null) + bfd = try(var.peer.bfd, null) + md5_authentication_key = try(var.peer.md5_authentication_key, null) }] }