Skip to content

Commit 82ccc35

Browse files
feat: add zero_advertised_route_priority to the interface module (terraform-google-modules#157)
Co-authored-by: Awais Malik <[email protected]>
1 parent d4b7c13 commit 82ccc35

File tree

10 files changed

+323
-93
lines changed

10 files changed

+323
-93
lines changed

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ docker_test_integration:
6969
docker_test_lint:
7070
docker run --rm -it \
7171
-v "$(CURDIR)":/workspace \
72+
-e ENABLE_BPMETADATA=1 \
7273
$(REGISTRY_URL)/${DOCKER_IMAGE_DEVELOPER_TOOLS}:${DOCKER_TAG_VERSION_DEVELOPER_TOOLS} \
7374
/usr/local/bin/test_lint.sh
7475

@@ -77,8 +78,9 @@ docker_test_lint:
7778
docker_generate_docs:
7879
docker run --rm -it \
7980
-v "$(CURDIR)":/workspace \
81+
-e ENABLE_BPMETADATA=1 \
8082
$(REGISTRY_URL)/${DOCKER_IMAGE_DEVELOPER_TOOLS}:${DOCKER_TAG_VERSION_DEVELOPER_TOOLS} \
81-
/bin/bash -c 'source /usr/local/bin/task_helper_functions.sh && generate_docs'
83+
/bin/bash -c 'source /usr/local/bin/task_helper_functions.sh && generate_docs display'
8284

8385
# Alias for backwards compatibility
8486
.PHONY: generate_docs

metadata.display.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
apiVersion: blueprints.cloud.google.com/v1alpha1
16+
kind: BlueprintMetadata
17+
metadata:
18+
name: terraform-google-cloud-router-display
19+
annotations:
20+
config.kubernetes.io/local-config: "true"
21+
spec:
22+
info:
23+
source:
24+
repo: https://github.com/terraform-google-modules/terraform-google-cloud-router.git
25+
sourceType: git
26+
ui:
27+
input:
28+
variables:
29+
bgp:
30+
name: bgp
31+
title: Bgp
32+
description:
33+
name: description
34+
title: Description
35+
encrypted_interconnect_router:
36+
name: encrypted_interconnect_router
37+
title: Encrypted Interconnect Router
38+
name:
39+
name: name
40+
title: Name
41+
nats:
42+
name: nats
43+
title: Nats
44+
network:
45+
name: network
46+
title: Network
47+
project:
48+
name: project
49+
title: Project
50+
region:
51+
name: region
52+
title: Region

metadata.yaml

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Google LLC
1+
# Copyright 2025 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -43,6 +43,29 @@ spec:
4343
location: examples/simple_example
4444
interfaces:
4545
variables:
46+
- name: name
47+
description: Name of the router
48+
varType: string
49+
required: true
50+
- name: network
51+
description: A reference to the network to which this router belongs
52+
varType: string
53+
required: true
54+
- name: project
55+
description: The project ID to deploy to
56+
varType: string
57+
required: true
58+
- name: region
59+
description: Region where the router resides
60+
varType: string
61+
required: true
62+
- name: description
63+
description: An optional description of this resource
64+
varType: string
65+
- name: encrypted_interconnect_router
66+
description: An optional field to indicate if a router is dedicated to use with encrypted Interconnect Attachment
67+
varType: bool
68+
defaultValue: false
4669
- name: bgp
4770
description: BGP information specific to this router.
4871
varType: |-
@@ -56,13 +79,6 @@ spec:
5679
})), [])
5780
keepalive_interval = optional(number)
5881
})
59-
- name: description
60-
description: An optional description of this resource
61-
varType: string
62-
- name: name
63-
description: Name of the router
64-
varType: string
65-
required: true
6682
- name: nats
6783
description: NATs to deploy on this router.
6884
varType: |-
@@ -71,6 +87,7 @@ spec:
7187
nat_ip_allocate_option = optional(string)
7288
source_subnetwork_ip_ranges_to_nat = optional(string)
7389
nat_ips = optional(list(string), [])
90+
drain_nat_ips = optional(list(string), [])
7491
min_ports_per_vm = optional(number)
7592
max_ports_per_vm = optional(number)
7693
udp_idle_timeout_sec = optional(number)
@@ -94,18 +111,6 @@ spec:
94111
95112
}))
96113
defaultValue: []
97-
- name: network
98-
description: A reference to the network to which this router belongs
99-
varType: string
100-
required: true
101-
- name: project
102-
description: The project ID to deploy to
103-
varType: string
104-
required: true
105-
- name: region
106-
description: Region where the router resides
107-
varType: string
108-
required: true
109114
outputs:
110115
- name: nat
111116
description: Created NATs
@@ -120,3 +125,6 @@ spec:
120125
- cloudresourcemanager.googleapis.com
121126
- serviceusage.googleapis.com
122127
- compute.googleapis.com
128+
providerVersions:
129+
- source: hashicorp/google
130+
version: ">= 4.51, < 7"
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
apiVersion: blueprints.cloud.google.com/v1alpha1
16+
kind: BlueprintMetadata
17+
metadata:
18+
name: terraform-google-cloud-router-interconnect-attachment-display
19+
annotations:
20+
config.kubernetes.io/local-config: "true"
21+
spec:
22+
info:
23+
title: Interconnect Attachment
24+
source:
25+
repo: https://github.com/terraform-google-modules/terraform-google-cloud-router.git
26+
sourceType: git
27+
dir: /modules/interconnect_attachment
28+
ui:
29+
input:
30+
variables:
31+
admin_enabled:
32+
name: admin_enabled
33+
title: Admin Enabled
34+
bandwidth:
35+
name: bandwidth
36+
title: Bandwidth
37+
candidate_subnets:
38+
name: candidate_subnets
39+
title: Candidate Subnets
40+
create_interface:
41+
name: create_interface
42+
title: Create Interface
43+
description:
44+
name: description
45+
title: Description
46+
edge_availability_domain:
47+
name: edge_availability_domain
48+
title: Edge Availability Domain
49+
encryption:
50+
name: encryption
51+
title: Encryption
52+
interconnect:
53+
name: interconnect
54+
title: Interconnect
55+
interface:
56+
name: interface
57+
title: Interface
58+
ipsec_internal_addresses:
59+
name: ipsec_internal_addresses
60+
title: Ipsec Internal Addresses
61+
mtu:
62+
name: mtu
63+
title: Mtu
64+
name:
65+
name: name
66+
title: Name
67+
peer:
68+
name: peer
69+
title: Peer
70+
project:
71+
name: project
72+
title: Project
73+
region:
74+
name: region
75+
title: Region
76+
router:
77+
name: router
78+
title: Router
79+
type:
80+
name: type
81+
title: Type
82+
vlan_tag8021q:
83+
name: vlan_tag8021q
84+
title: Vlan Tag8021q

modules/interconnect_attachment/metadata.yaml

Lines changed: 54 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Google LLC
1+
# Copyright 2025 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -40,38 +40,71 @@ spec:
4040
location: examples/simple_example
4141
interfaces:
4242
variables:
43+
- name: name
44+
description: The name of the interconnect attachment
45+
varType: string
46+
required: true
47+
- name: project
48+
description: The project ID to deploy to
49+
varType: string
50+
required: true
51+
- name: router
52+
description: Name of the router the attachment resides
53+
varType: string
54+
required: true
55+
- name: region
56+
description: Region where the attachment resides
57+
varType: string
58+
required: true
59+
- name: interconnect
60+
description: URL of the underlying Interconnect object that this attachment's traffic will traverse through.
61+
varType: string
62+
defaultValue: ""
4363
- name: admin_enabled
4464
description: Whether the VLAN attachment is enabled or disabled
4565
varType: bool
4666
defaultValue: true
67+
- name: type
68+
description: The type of InterconnectAttachment you wish to create
69+
varType: string
70+
defaultValue: DEDICATED
4771
- name: bandwidth
4872
description: Provisioned bandwidth capacity for the interconnect attachment
4973
varType: string
5074
defaultValue: BPS_10G
75+
- name: mtu
76+
description: 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.
77+
varType: string
78+
- name: edge_availability_domain
79+
description: Desired availability domain for the attachment. Only available for type PARTNER, at creation time.
80+
varType: string
81+
- name: description
82+
description: An optional description of this resource
83+
varType: string
5184
- name: candidate_subnets
5285
description: Up to 16 candidate prefixes that can be used to restrict the allocation of cloudRouterIpAddress and customerRouterIpAddress for this attachment. All prefixes must be within link-local address space (169.254.0.0/16) and must be /29 or shorter (/28, /27, etc).
5386
varType: list(string)
54-
- name: description
55-
description: An optional description of this resource
87+
- name: vlan_tag8021q
88+
description: The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4094.
5689
varType: string
57-
- name: interconnect
58-
description: URL of the underlying Interconnect object that this attachment's traffic will traverse through.
90+
- name: encryption
91+
description: Indicates the user-supplied encryption option of this interconnect attachment.
5992
varType: string
60-
required: true
93+
defaultValue: NONE
94+
- name: ipsec_internal_addresses
95+
description: URL of addresses that have been reserved for the interconnect attachment, Used only for interconnect attachment that has the encryption option as IPSEC.
96+
varType: list(string)
97+
defaultValue: []
98+
- name: create_interface
99+
description: Whether to create router interface (and peer) for this attachment. Set this to false for PARTNER type.
100+
varType: bool
101+
defaultValue: true
61102
- name: interface
62103
description: Interface to deploy for this attachment.
63104
varType: |-
64105
object({
65106
name = string
66107
})
67-
required: true
68-
- name: mtu
69-
description: 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.
70-
varType: string
71-
- name: name
72-
description: The name of the interconnect attachment
73-
varType: string
74-
required: true
75108
- name: peer
76109
description: BGP Peer for this attachment.
77110
varType: |-
@@ -85,27 +118,11 @@ spec:
85118
min_receive_interval = optional(number)
86119
multiplier = optional(number)
87120
}))
121+
md5_authentication_key = optional(object({
122+
name = string
123+
key = string
124+
}))
88125
})
89-
required: true
90-
- name: project
91-
description: The project ID to deploy to
92-
varType: string
93-
required: true
94-
- name: region
95-
description: Region where the attachment resides
96-
varType: string
97-
required: true
98-
- name: router
99-
description: Name of the router the attachment resides
100-
varType: string
101-
required: true
102-
- name: type
103-
description: The type of InterconnectAttachment you wish to create
104-
varType: string
105-
defaultValue: DEDICATED
106-
- name: vlan_tag8021q
107-
description: The IEEE 802.1Q VLAN tag for this attachment, in the range 2-4094.
108-
varType: string
109126
outputs:
110127
- name: attachment
111128
description: The created attachment
@@ -120,3 +137,6 @@ spec:
120137
- cloudresourcemanager.googleapis.com
121138
- serviceusage.googleapis.com
122139
- compute.googleapis.com
140+
providerVersions:
141+
- source: hashicorp/google
142+
version: ">= 4.27, < 7"

modules/interface/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
| interconnect\_attachment | The name or resource link to the VLAN interconnect for this interface | `string` | `null` | no |
99
| ip\_range | IP address and range of the interface | `string` | `null` | no |
1010
| name | The name of the interface | `string` | n/a | yes |
11-
| peers | BGP peers for this interface. | <pre>list(object({<br> name = string<br> peer_ip_address = string<br> peer_asn = string<br> advertised_route_priority = optional(number)<br> bfd = object({<br> session_initialization_mode = string<br> min_transmit_interval = optional(number)<br> min_receive_interval = optional(number)<br> multiplier = optional(number)<br> })<br> md5_authentication_key = optional(object({<br> name = string<br> key = string<br> }))<br> }))</pre> | `[]` | no |
11+
| peers | BGP peers for this interface. | <pre>list(object({<br> name = string<br> peer_ip_address = string<br> peer_asn = string<br> advertised_route_priority = optional(number)<br> zero_advertised_route_priority = optional(bool)<br> bfd = object({<br> session_initialization_mode = string<br> min_transmit_interval = optional(number)<br> min_receive_interval = optional(number)<br> multiplier = optional(number)<br> })<br> md5_authentication_key = optional(object({<br> name = string<br> key = string<br> }))<br> }))</pre> | `[]` | no |
1212
| project | The project ID to deploy to | `string` | n/a | yes |
1313
| region | Region where the interface resides | `string` | n/a | yes |
1414
| router | Name of the router the interface resides | `string` | n/a | yes |

0 commit comments

Comments
 (0)