Skip to content

Commit e1fab42

Browse files
authored
Merge branch 'main' into dependabot/go_modules/test/integration/golang.org/x/net-0.38.0
2 parents 91ec209 + 6ecb4a2 commit e1fab42

File tree

21 files changed

+407
-117
lines changed

21 files changed

+407
-117
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,24 @@ The format is based on
77
and this project adheres to
88
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
99

10+
## [7.0.0](https://github.com/terraform-google-modules/terraform-google-cloud-router/compare/v6.3.0...v7.0.0) (2025-04-28)
11+
12+
13+
### ⚠ BREAKING CHANGES
14+
15+
* **TPG >= 5.12:** update interface module min provider version >= 5.12 ([#153](https://github.com/terraform-google-modules/terraform-google-cloud-router/issues/153))
16+
* MD5 authentication for BGP support
17+
18+
### Features
19+
20+
* MD5 authentication for BGP support ([e6f8b6c](https://github.com/terraform-google-modules/terraform-google-cloud-router/commit/e6f8b6c73f564faea90b90b468757e5e35b244a6))
21+
* partner interconnect ([#147](https://github.com/terraform-google-modules/terraform-google-cloud-router/issues/147)) ([0cff190](https://github.com/terraform-google-modules/terraform-google-cloud-router/commit/0cff1905735f4de59b65e12793adec7d3d6fa777))
22+
23+
24+
### Bug Fixes
25+
26+
* **TPG >= 5.12:** update interface module min provider version >= 5.12 ([#153](https://github.com/terraform-google-modules/terraform-google-cloud-router/issues/153)) ([532c95d](https://github.com/terraform-google-modules/terraform-google-cloud-router/commit/532c95d348055bc8d8eac198837f83352409c3a5))
27+
1028
## [6.3.0](https://github.com/terraform-google-modules/terraform-google-cloud-router/compare/v6.2.0...v6.3.0) (2025-03-05)
1129

1230

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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Basic usage of this module is as follows:
1919
```hcl
2020
module "cloud_router" {
2121
source = "terraform-google-modules/cloud-router/google"
22-
version = "~> 6.3"
22+
version = "~> 7.0"
2323
2424
name = "example-router"
2525
region = "us-central1"

examples/interconnect_attachment/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
module "cloud_router" {
1818
source = "terraform-google-modules/cloud-router/google"
19-
version = "~> 6.0"
19+
version = "~> 7.0"
2020

2121
name = "example-router"
2222
project = "example-project"
@@ -31,7 +31,7 @@ module "cloud_router" {
3131

3232
module "interconnect_attachment" {
3333
source = "terraform-google-modules/cloud-router/google//modules/interconnect_attachment"
34-
version = "~> 6.0"
34+
version = "~> 7.0"
3535

3636
name = "example-attachment"
3737
project = "example-project"

examples/nat/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
module "vpc" {
1818
source = "terraform-google-modules/network/google"
19-
version = "~> 10.0"
19+
version = "~> 11.0"
2020

2121
project_id = var.project_id
2222
network_name = "test-network"
@@ -42,7 +42,7 @@ module "vpc" {
4242
# [START cloudnat_simple_create]
4343
module "cloud_router" {
4444
source = "terraform-google-modules/cloud-router/google"
45-
version = "~> 6.0"
45+
version = "~> 7.0"
4646
name = "my-cloud-router"
4747
project = var.project_id
4848
network = module.vpc.network_name

examples/simple_example/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
module "vpc" {
1818
source = "terraform-google-modules/network/google"
19-
version = "~> 10.0"
19+
version = "~> 11.0"
2020

2121
project_id = var.project_id
2222
network_name = "test-network"
@@ -28,7 +28,7 @@ module "vpc" {
2828
# [START cloudrouter_create]
2929
module "cloud_router" {
3030
source = "terraform-google-modules/cloud-router/google"
31-
version = "~> 6.0"
31+
version = "~> 7.0"
3232

3333
name = "my-router"
3434
region = "us-central1"

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: 29 additions & 21 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.
@@ -23,7 +23,7 @@ spec:
2323
source:
2424
repo: https://github.com/terraform-google-modules/terraform-google-cloud-router.git
2525
sourceType: git
26-
version: 6.3.0
26+
version: 7.0.0
2727
actuationTool:
2828
flavor: Terraform
2929
version: ">= 1.3"
@@ -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"

modules/interconnect_attachment/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@
88
| admin\_enabled | Whether the VLAN attachment is enabled or disabled | `bool` | `true` | no |
99
| bandwidth | Provisioned bandwidth capacity for the interconnect attachment | `string` | `"BPS_10G"` | no |
1010
| candidate\_subnets | 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). | `list(string)` | `null` | no |
11+
| create\_interface | Whether to create router interface (and peer) for this attachment. Set this to false for PARTNER type. | `bool` | `true` | no |
1112
| description | An optional description of this resource | `string` | `null` | no |
13+
| edge\_availability\_domain | Desired availability domain for the attachment. Only available for type PARTNER, at creation time. | `string` | `null` | no |
1214
| encryption | Indicates the user-supplied encryption option of this interconnect attachment. | `string` | `"NONE"` | no |
13-
| interconnect | URL of the underlying Interconnect object that this attachment's traffic will traverse through. | `string` | n/a | yes |
14-
| interface | Interface to deploy for this attachment. | <pre>object({<br> name = string<br> })</pre> | n/a | yes |
15+
| interconnect | URL of the underlying Interconnect object that this attachment's traffic will traverse through. | `string` | `""` | no |
16+
| interface | Interface to deploy for this attachment. | <pre>object({<br> name = string<br> })</pre> | `null` | no |
1517
| 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 |
1618
| 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 |
1719
| name | The name of the interconnect attachment | `string` | n/a | yes |
18-
| peer | BGP Peer for this attachment. | <pre>object({<br> name = string<br> peer_asn = string<br> advertised_route_priority = optional(number)<br> bfd = optional(object({<br> session_initialization_mode = string<br> min_transmit_interval = optional(number)<br> min_receive_interval = optional(number)<br> multiplier = optional(number)<br> }))<br> })</pre> | n/a | yes |
20+
| peer | BGP Peer for this attachment. | <pre>object({<br> name = string<br> peer_asn = string<br> advertised_route_priority = optional(number)<br> bfd = optional(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> | `null` | no |
1921
| project | The project ID to deploy to | `string` | n/a | yes |
2022
| region | Region where the attachment resides | `string` | n/a | yes |
2123
| router | Name of the router the attachment resides | `string` | n/a | yes |

modules/interconnect_attachment/main.tf

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ resource "google_compute_interconnect_attachment" "attachment" {
2222
interconnect = var.interconnect
2323
admin_enabled = var.admin_enabled
2424
type = var.type
25+
edge_availability_domain = var.edge_availability_domain
2526
description = var.description
26-
bandwidth = var.bandwidth
27+
bandwidth = var.type == "DEDICATED" ? var.bandwidth : null
2728
mtu = var.mtu
2829
candidate_subnets = var.candidate_subnets
2930
vlan_tag8021q = var.vlan_tag8021q
@@ -32,20 +33,28 @@ resource "google_compute_interconnect_attachment" "attachment" {
3233
}
3334

3435
module "interface" {
36+
count = var.create_interface ? 1 : 0
37+
3538
source = "../interface"
36-
name = var.interface.name
39+
name = try(var.interface.name, null)
3740
project = var.project
3841
router = var.router
3942
region = var.region
4043
ip_range = google_compute_interconnect_attachment.attachment.cloud_router_ip_address
4144
interconnect_attachment = google_compute_interconnect_attachment.attachment.self_link
4245
peers = [{
43-
name = var.peer.name
46+
name = try(var.peer.name, null)
4447

4548
# Peer IP Address must not contain the subnet mask, else will throw an invalid IP address error.
4649
peer_ip_address = element(split("/", google_compute_interconnect_attachment.attachment.customer_router_ip_address), 0)
47-
peer_asn = var.peer.peer_asn
48-
advertised_route_priority = lookup(var.peer, "advertised_route_priority", null)
49-
bfd = lookup(var.peer, "bfd", null)
50+
peer_asn = try(var.peer.peer_asn, null)
51+
advertised_route_priority = try(var.peer.advertised_route_priority, null)
52+
bfd = try(var.peer.bfd, null)
53+
md5_authentication_key = try(var.peer.md5_authentication_key, null)
5054
}]
5155
}
56+
57+
moved {
58+
from = module.interface
59+
to = module.interface[0]
60+
}

0 commit comments

Comments
 (0)