Skip to content

Commit 8862c88

Browse files
feat!: rename project input variable to project_id for consistency (#173)
Co-authored-by: Bharath KKB <[email protected]>
1 parent 7b2c568 commit 8862c88

File tree

15 files changed

+43
-40
lines changed

15 files changed

+43
-40
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Functional examples are included in the [examples](./examples/) directory. By de
4848
| name | Name of the router | `string` | n/a | yes |
4949
| 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 |
5050
| network | A reference to the network to which this router belongs | `string` | n/a | yes |
51-
| project | The project ID to deploy to | `string` | n/a | yes |
51+
| project\_id | The project ID to deploy to | `string` | n/a | yes |
5252
| region | Region where the router resides | `string` | n/a | yes |
5353

5454
## Outputs

docs/upgrading_to_v8.0.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Upgrading to v8.0
2+
3+
The v8.0 release contains backwards-incompatible changes.
4+
5+
### [`project` variable](https://github.com/terraform-google-modules/terraform-google-cloud-router/blob/v7.4.0/variables.tf#L25) renamed to `project_id`
6+
7+
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`).
8+
9+
To upgrade, module calls must be updated to use the `project_id` argument and the version constraint must be updated to `~> 8.0`.

examples/interconnect_attachment/main.tf

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@
1515
*/
1616

1717
module "cloud_router" {
18-
source = "terraform-google-modules/cloud-router/google"
19-
version = "~> 7.0"
18+
source = "../.."
2019

2120
name = "example-router"
22-
project = "example-project"
21+
project_id = "example-project"
2322
network = "default"
2423
region = "us-central1"
2524

examples/nat/main.tf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ module "vpc" {
4141

4242
# [START cloudnat_simple_create]
4343
module "cloud_router" {
44-
source = "terraform-google-modules/cloud-router/google"
45-
version = "~> 7.0"
46-
name = "my-cloud-router"
47-
project = var.project_id
48-
network = module.vpc.network_name
49-
region = "us-central1"
44+
source = "../.."
45+
46+
name = "my-cloud-router"
47+
project_id = var.project_id
48+
network = module.vpc.network_name
49+
region = "us-central1"
5050

5151
nats = [{
5252
name = "my-nat-gateway"

examples/simple_example/main.tf

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ module "vpc" {
2727

2828
# [START cloudrouter_create]
2929
module "cloud_router" {
30-
source = "terraform-google-modules/cloud-router/google"
31-
version = "~> 7.0"
30+
source = "../.."
3231

3332
name = "my-router"
3433
region = "us-central1"
@@ -39,7 +38,7 @@ module "cloud_router" {
3938
asn = "65001"
4039
}
4140

42-
project = var.project_id
43-
network = module.vpc.network_name
41+
project_id = var.project_id
42+
network = module.vpc.network_name
4443
}
4544
# [END cloudrouter_create]

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ resource "google_compute_router" "router" {
1818
name = var.name
1919
network = var.network
2020
region = var.region
21-
project = var.project
21+
project = var.project_id
2222
description = var.description
2323
encrypted_interconnect_router = var.encrypted_interconnect_router
2424

metadata.display.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ spec:
4747
network:
4848
name: network
4949
title: Network
50-
project:
51-
name: project
52-
title: Project
50+
project_id:
51+
name: project_id
52+
title: Project_Id
5353
region:
5454
name: region
5555
title: Region

metadata.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ metadata:
2020
config.kubernetes.io/local-config: "true"
2121
spec:
2222
info:
23+
title: "Cloud Router"
2324
title: "Cloud Router"
2425
source:
2526
repo: https://github.com/terraform-google-modules/terraform-google-cloud-router.git
@@ -55,20 +56,20 @@ spec:
5556
connections:
5657
- source:
5758
source: github.com/terraform-google-modules/terraform-google-network
58-
version: ">= 11.0.0"
59+
version: ">= 12.0.0"
5960
spec:
6061
outputExpr: network_name
6162
- source:
6263
source: github.com/terraform-google-modules/terraform-google-network//modules/vpc
63-
version: ">= 11.0.0"
64+
version: ">= 12.0.0"
6465
spec:
6566
outputExpr: network_name
6667
- source:
6768
source: github.com/GoogleCloudPlatform/terraform-google-vpn
68-
version: ">= 5.0.0"
69+
version: ">= 6.1.0"
6970
spec:
7071
outputExpr: network
71-
- name: project
72+
- name: project_id
7273
description: The project ID to deploy to
7374
varType: string
7475
required: true

modules/interconnect_attachment/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ module "interface" {
3737

3838
source = "../interface"
3939
name = try(var.interface.name, null)
40-
project = var.project
40+
project_id = var.project
4141
router = var.router
4242
region = var.region
4343
ip_range = google_compute_interconnect_attachment.attachment.cloud_router_ip_address

modules/interface/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
| ip\_range | IP address and range of the interface | `string` | `null` | no |
1010
| name | The name of the interface | `string` | n/a | yes |
1111
| 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 |
12-
| project | The project ID to deploy to | `string` | n/a | yes |
12+
| project\_id | 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 |
1515
| vpn\_tunnel | The name or resource link to the VPN tunnel this interface will be linked to | `string` | `null` | no |

0 commit comments

Comments
 (0)