diff --git a/README.md b/README.md index 8acffcf..b35fc9a 100644 --- a/README.md +++ b/README.md @@ -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. |
list(object({
name = string
nat_ip_allocate_option = optional(string)
source_subnetwork_ip_ranges_to_nat = optional(string)
nat_ips = optional(list(string), [])
drain_nat_ips = optional(list(string), [])
min_ports_per_vm = optional(number)
max_ports_per_vm = optional(number)
udp_idle_timeout_sec = optional(number)
icmp_idle_timeout_sec = optional(number)
tcp_established_idle_timeout_sec = optional(number)
tcp_transitory_idle_timeout_sec = optional(number)
tcp_time_wait_timeout_sec = optional(number)
enable_endpoint_independent_mapping = optional(bool)
enable_dynamic_port_allocation = optional(bool)

log_config = optional(object({
enable = optional(bool, true)
filter = optional(string, "ALL")
}), {})

subnetworks = optional(list(object({
name = string
source_ip_ranges_to_nat = list(string)
secondary_ip_range_names = optional(list(string))
})), [])

}))
| `[]` | 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 diff --git a/docs/upgrading_to_v8.0.md b/docs/upgrading_to_v8.0.md new file mode 100644 index 0000000..e588519 --- /dev/null +++ b/docs/upgrading_to_v8.0.md @@ -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`. diff --git a/examples/interconnect_attachment/main.tf b/examples/interconnect_attachment/main.tf index 7f4b32c..78a7431 100644 --- a/examples/interconnect_attachment/main.tf +++ b/examples/interconnect_attachment/main.tf @@ -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" diff --git a/examples/nat/main.tf b/examples/nat/main.tf index 658c652..31848da 100644 --- a/examples/nat/main.tf +++ b/examples/nat/main.tf @@ -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" diff --git a/examples/simple_example/main.tf b/examples/simple_example/main.tf index 091c49f..d9322db 100644 --- a/examples/simple_example/main.tf +++ b/examples/simple_example/main.tf @@ -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" @@ -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] diff --git a/main.tf b/main.tf index 09aab19..c368415 100644 --- a/main.tf +++ b/main.tf @@ -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 diff --git a/metadata.display.yaml b/metadata.display.yaml index 6616364..530ca63 100644 --- a/metadata.display.yaml +++ b/metadata.display.yaml @@ -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 diff --git a/metadata.yaml b/metadata.yaml index d9d0799..29e38f2 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -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 @@ -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 diff --git a/modules/interconnect_attachment/main.tf b/modules/interconnect_attachment/main.tf index 1c151f4..9b6f224 100644 --- a/modules/interconnect_attachment/main.tf +++ b/modules/interconnect_attachment/main.tf @@ -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 diff --git a/modules/interface/README.md b/modules/interface/README.md index fbc8234..654e0ce 100644 --- a/modules/interface/README.md +++ b/modules/interface/README.md @@ -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. |
list(object({
name = string
peer_ip_address = string
peer_asn = string
advertised_route_priority = optional(number)
zero_advertised_route_priority = optional(bool)
bfd = 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
}))
}))
| `[]` | 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 | diff --git a/modules/interface/main.tf b/modules/interface/main.tf index 43428df..69cd022 100644 --- a/modules/interface/main.tf +++ b/modules/interface/main.tf @@ -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 diff --git a/modules/interface/metadata.display.yaml b/modules/interface/metadata.display.yaml index 009c2b2..1620a82 100644 --- a/modules/interface/metadata.display.yaml +++ b/modules/interface/metadata.display.yaml @@ -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 diff --git a/modules/interface/metadata.yaml b/modules/interface/metadata.yaml index 17afb5f..a8904a1 100644 --- a/modules/interface/metadata.yaml +++ b/modules/interface/metadata.yaml @@ -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 @@ -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 @@ -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 diff --git a/modules/interface/variables.tf b/modules/interface/variables.tf index 7d90fc0..2c68aec 100644 --- a/modules/interface/variables.tf +++ b/modules/interface/variables.tf @@ -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" } diff --git a/variables.tf b/variables.tf index 9f5e203..f7a5134 100644 --- a/variables.tf +++ b/variables.tf @@ -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" }