Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Functional examples are included in the [examples](./examples/) directory. By de
| name | Name of the router | `string` | n/a | yes |
| nats | NATs to deploy on this router. | <pre>list(object({<br> name = string<br> nat_ip_allocate_option = optional(string)<br> source_subnetwork_ip_ranges_to_nat = optional(string)<br> nat_ips = optional(list(string), [])<br> drain_nat_ips = optional(list(string), [])<br> min_ports_per_vm = optional(number)<br> max_ports_per_vm = optional(number)<br> udp_idle_timeout_sec = optional(number)<br> icmp_idle_timeout_sec = optional(number)<br> tcp_established_idle_timeout_sec = optional(number)<br> tcp_transitory_idle_timeout_sec = optional(number)<br> tcp_time_wait_timeout_sec = optional(number)<br> enable_endpoint_independent_mapping = optional(bool)<br> enable_dynamic_port_allocation = optional(bool)<br><br> log_config = optional(object({<br> enable = optional(bool, true)<br> filter = optional(string, "ALL")<br> }), {})<br><br> subnetworks = optional(list(object({<br> name = string<br> source_ip_ranges_to_nat = list(string)<br> secondary_ip_range_names = optional(list(string))<br> })), [])<br><br> }))</pre> | `[]` | no |
| network | A reference to the network to which this router belongs | `string` | n/a | yes |
| project | The project ID to deploy to | `string` | n/a | yes |
| project\_id | The project ID to deploy to | `string` | n/a | yes |
| region | Region where the router resides | `string` | n/a | yes |

## Outputs
Expand Down
9 changes: 9 additions & 0 deletions docs/upgrading_to_v8.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Upgrading to v8.0

The v8.0 release contains backwards-incompatible changes.

### [`project` variable](https://github.com/terraform-google-modules/terraform-google-cloud-router/blob/v7.4.0/variables.tf#L25) renamed to `project_id`

To align with the standard naming conventions, the `project` input variable has been renamed to `project_id`. This change applies to the main module and submodule (`interface`).

To upgrade, module calls must be updated to use the `project_id` argument and the version constraint must be updated to `~> 8.0`.
5 changes: 2 additions & 3 deletions examples/interconnect_attachment/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@
*/

module "cloud_router" {
source = "terraform-google-modules/cloud-router/google"
version = "~> 7.0"
source = "../.."

name = "example-router"
project = "example-project"
project_id = "example-project"
network = "default"
region = "us-central1"

Expand Down
12 changes: 6 additions & 6 deletions examples/nat/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ module "vpc" {

# [START cloudnat_simple_create]
module "cloud_router" {
source = "terraform-google-modules/cloud-router/google"
version = "~> 7.0"
name = "my-cloud-router"
project = var.project_id
network = module.vpc.network_name
region = "us-central1"
source = "../.."

name = "my-cloud-router"
project_id = var.project_id
network = module.vpc.network_name
region = "us-central1"

nats = [{
name = "my-nat-gateway"
Expand Down
7 changes: 3 additions & 4 deletions examples/simple_example/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ module "vpc" {

# [START cloudrouter_create]
module "cloud_router" {
source = "terraform-google-modules/cloud-router/google"
version = "~> 7.0"
source = "../.."

name = "my-router"
region = "us-central1"
Expand All @@ -39,7 +38,7 @@ module "cloud_router" {
asn = "65001"
}

project = var.project_id
network = module.vpc.network_name
project_id = var.project_id
network = module.vpc.network_name
}
# [END cloudrouter_create]
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ resource "google_compute_router" "router" {
name = var.name
network = var.network
region = var.region
project = var.project
project = var.project_id
description = var.description
encrypted_interconnect_router = var.encrypted_interconnect_router

Expand Down
6 changes: 3 additions & 3 deletions metadata.display.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ spec:
network:
name: network
title: Network
project:
name: project
title: Project
project_id:
name: project_id
title: Project_Id
region:
name: region
title: Region
9 changes: 5 additions & 4 deletions metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ metadata:
config.kubernetes.io/local-config: "true"
spec:
info:
title: "Cloud Router"
title: "Cloud Router"
source:
repo: https://github.com/terraform-google-modules/terraform-google-cloud-router.git
Expand Down Expand Up @@ -55,20 +56,20 @@ spec:
connections:
- source:
source: github.com/terraform-google-modules/terraform-google-network
version: ">= 11.0.0"
version: ">= 12.0.0"
spec:
outputExpr: network_name
- source:
source: github.com/terraform-google-modules/terraform-google-network//modules/vpc
version: ">= 11.0.0"
version: ">= 12.0.0"
spec:
outputExpr: network_name
- source:
source: github.com/GoogleCloudPlatform/terraform-google-vpn
version: ">= 5.0.0"
version: ">= 6.1.0"
spec:
outputExpr: network
- name: project
- name: project_id
description: The project ID to deploy to
varType: string
required: true
Expand Down
2 changes: 1 addition & 1 deletion modules/interconnect_attachment/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module "interface" {

source = "../interface"
name = try(var.interface.name, null)
project = var.project
project_id = var.project
router = var.router
region = var.region
ip_range = google_compute_interconnect_attachment.attachment.cloud_router_ip_address
Expand Down
2 changes: 1 addition & 1 deletion modules/interface/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
| ip\_range | IP address and range of the interface | `string` | `null` | no |
| name | The name of the interface | `string` | n/a | yes |
| 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 |
| project | The project ID to deploy to | `string` | n/a | yes |
| project\_id | The project ID to deploy to | `string` | n/a | yes |
| region | Region where the interface resides | `string` | n/a | yes |
| router | Name of the router the interface resides | `string` | n/a | yes |
| vpn\_tunnel | The name or resource link to the VPN tunnel this interface will be linked to | `string` | `null` | no |
Expand Down
2 changes: 1 addition & 1 deletion modules/interface/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

resource "google_compute_router_interface" "interface" {
name = var.name
project = var.project
project = var.project_id
router = var.router
region = var.region
ip_range = var.ip_range
Expand Down
6 changes: 3 additions & 3 deletions modules/interface/metadata.display.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ spec:
peers:
name: peers
title: Peers
project:
name: project
title: Project
project_id:
name: project_id
title: Project_Id
region:
name: region
title: Region
Expand Down
15 changes: 5 additions & 10 deletions modules/interface/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ spec:
description: The name of the interface
varType: string
required: true
- name: project
- name: project_id
description: The project ID to deploy to
varType: string
required: true
Expand All @@ -55,17 +55,17 @@ spec:
connections:
- source:
source: github.com/terraform-google-modules/terraform-google-cloud-router
version: ">= 7.0.0"
version: ">= 7.4.0"
spec:
outputExpr: router.name
- source:
source: github.com/terraform-google-modules/terraform-google-cloud-nat
version: ">= 4.0.0"
version: ">= 5.4.0"
spec:
outputExpr: router_name
- source:
source: github.com/terraform-google-modules/terraform-google-vpn//modules/vpn-ha
version: ">= 5.0.0"
version: ">= 6.1.0"
spec:
outputExpr: router_name
- name: region
Expand All @@ -79,14 +79,9 @@ spec:
description: The name or resource link to the VPN tunnel this interface will be linked to
varType: string
connections:
- source:
source: github.com/terraform-google-modules/terraform-google-vpn//modules/vpn-ha
version: ">= 5.0.0"
spec:
outputExpr: values(tunnel_self_links)[0]
- source:
source: github.com/terraform-google-modules/terraform-google-vpn
version: ">= 5.0.0"
version: ">= 6.1.0"
spec:
outputExpr: vpn_tunnels_self_link-dynamic[0]
- name: interconnect_attachment
Expand Down
2 changes: 1 addition & 1 deletion modules/interface/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ variable "name" {
description = "The name of the interface"
}

variable "project" {
variable "project_id" {
type = string
description = "The project ID to deploy to"
}
Expand Down
2 changes: 1 addition & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ variable "network" {
description = "A reference to the network to which this router belongs"
}

variable "project" {
variable "project_id" {
type = string
description = "The project ID to deploy to"
}
Expand Down