Skip to content

Commit 86e34bd

Browse files
authored
Merge pull request #64 from paulpalamarchuk/set_deafult_values_for_next_hop_internet
Set default value for `next_hop_internet` variable
2 parents 4657284 + 30405c2 commit 86e34bd

File tree

5 files changed

+23
-19
lines changed

5 files changed

+23
-19
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning][semver-site].
77

88
## [Unreleased]
99

10+
### Changed
11+
12+
- Set default value for `next_hop_internet`. [#64]
13+
1014
### Added
1115

1216
- Add host service agent role management to Shared VPC submodule [#72]
@@ -119,6 +123,7 @@ and this project adheres to [Semantic Versioning][semver-site].
119123
[0.2.0]: https://github.com/terraform-google-modules/terraform-google-network/compare/v0.1.0...v0.2.0
120124
[0.1.0]: https://github.com/terraform-google-modules/terraform-google-network/releases/tag/v0.1.0
121125

126+
[#64]: https://github.com/terraform-google-modules/terraform-google-network/pull/64
122127
[#66]: https://github.com/terraform-google-modules/terraform-google-network/pull/66
123128
[#16]: https://github.com/terraform-google-modules/terraform-google-network/pull/16
124129
[#57]: https://github.com/terraform-google-modules/terraform-google-network/pull/57

README.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -117,28 +117,27 @@ The subnets list contains maps, where each object represents a subnet. Each map
117117

118118
| Name | Description | Type | Default | Required |
119119
|------|-------------|:----:|:-----:|:-----:|
120-
| subnet_name | The name of the subnet being created | string | - | yes |
121-
| subnet_ip | The IP and CIDR range of the subnet being created | string | - | yes |
122-
| subnet_region | The region where the subnet will be created | string | - | yes |
123-
| subnet_private_access | Whether this subnet will have private Google access enabled | string | false | no |
124-
| subnet_flow_logs | Whether the subnet will record and send flow log data to logging | string | false | no |
125-
| description | The description of the subnet being created | string | null | no |
120+
| subnet\_name | The name of the subnet being created | string | - | yes |
121+
| subnet\_ip | The IP and CIDR range of the subnet being created | string | - | yes |
122+
| subnet\_region | The region where the subnet will be created | string | - | yes |
123+
| subnet\_private\_access | Whether this subnet will have private Google access enabled | string | `"false"` | no |
124+
| subnet\_flow\_logs | Whether the subnet will record and send flow log data to logging | string | `"false"` | no |
126125

127126
### Route Inputs
128-
The routes list contains maps, where each object represents a route. For the next_hop_* inputs, only one is possible to be used in each route. Having two next_hop_* inputs will produce an error. Each map has the following inputs (please see examples folder for additional references):
127+
The routes list contains maps, where each object represents a route. For the next\_hop\_* inputs, only one is possible to be used in each route. Having two next_hop_* inputs will produce an error. Each map has the following inputs (please see examples folder for additional references):
129128

130129
| Name | Description | Type | Default | Required |
131130
|------|-------------|:----:|:-----:|:-----:|
132131
| name | The name of the route being created | string | - | no |
133132
| description | The description of the route being created | string | - | no |
134133
| tags | The network tags assigned to this route. This is a list in string format. Eg. "tag-01,tag-02"| string | - | yes |
135-
| destination_range | The destination range of outgoing packets that this route applies to. Only IPv4 is supported | string | - | yes
136-
| next_hop_internet | Whether the next hop to this route will the default internet gateway. Use "true" to enable this as next hop | string | - | yes |
137-
| next_hop_ip | Network IP address of an instance that should handle matching packets | string | - | yes |
138-
| next_hop_instance | URL or name of an instance that should handle matching packets. If just name is specified "next_hop_instance_zone" is required | string | - | yes |
139-
| next_hop_instance_zone | The zone of the instance specified in next_hop_instance. Only required if next_hop_instance is specified as a name | string | - | no |
140-
| next_hop_vpn_tunnel | URL to a VpnTunnel that should handle matching packets | string | - | yes |
141-
| priority | The priority of this route. Priority is used to break ties in cases where there is more than one matching route of equal prefix length. In the case of two routes with equal prefix length, the one with the lowest-numbered priority value wins | string | 1000 | yes |
134+
| destination\_range | The destination range of outgoing packets that this route applies to. Only IPv4 is supported | string | - | yes
135+
| next\_hop\_internet | Whether the next hop to this route will the default internet gateway. Use "true" to enable this as next hop | string | `"false"` | yes |
136+
| next\_hop\_ip | Network IP address of an instance that should handle matching packets | string | - | yes |
137+
| next\_hop\_instance | URL or name of an instance that should handle matching packets. If just name is specified "next\_hop\_instance\_zone" is required | string | - | yes |
138+
| next\_hop\_instance\_zone | The zone of the instance specified in next\_hop\_instance. Only required if next\_hop\_instance is specified as a name | string | - | no |
139+
| next\_hop\_vpn\_tunnel | URL to a VpnTunnel that should handle matching packets | string | - | yes |
140+
| priority | The priority of this route. Priority is used to break ties in cases where there is more than one matching route of equal prefix length. In the case of two routes with equal prefix length, the one with the lowest-numbered priority value wins | string | `"1000"` | yes |
142141

143142
## Requirements
144143
### Installed Software

examples/submodule_svpc_access/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ Subnet-level access in this example is only granted to the default GCE service a
1717
|------|-------------|:----:|:-----:|:-----:|
1818
| host\_project\_id | Id of the host project where the shared VPC will be created. | string | n/a | yes |
1919
| network\_name | Name of the shared VPC. | string | `"test-svpc"` | no |
20-
| service\_project\_id\_full\_access | Id of the service project that will get VPC-level access. | string | n/a | yes |
21-
| service\_project\_number\_first\_subnet | Project number to derive service accounts with access to first subnet. | string | n/a | yes |
22-
| service\_project\_number\_multi\_subnet | Project number to derive service accounts with access to first and second subnet. | string | n/a | yes |
20+
| service\_project\_id | Service project id. | string | n/a | yes |
21+
| service\_project\_number | Service project number. | string | n/a | yes |
22+
| service\_project\_owners | Service project owners, in IAM format. | list | `<list>` | no |
2323

2424
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ resource "google_compute_route" "route" {
6969
description = lookup(var.routes[count.index], "description", "")
7070
tags = compact(split(",", lookup(var.routes[count.index], "tags", "")))
7171
dest_range = lookup(var.routes[count.index], "destination_range", "")
72-
next_hop_gateway = lookup(var.routes[count.index], "next_hop_internet", "") == "true" ? "default-internet-gateway" : ""
72+
next_hop_gateway = lookup(var.routes[count.index], "next_hop_internet", "false") == "true" ? "default-internet-gateway" : ""
7373
next_hop_ip = lookup(var.routes[count.index], "next_hop_ip", "")
7474
next_hop_instance = lookup(var.routes[count.index], "next_hop_instance", "")
7575
next_hop_instance_zone = lookup(var.routes[count.index], "next_hop_instance_zone", "")

modules/fabric-net-svpc-access/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This module allows configuring service project access to a Shared VPC, created w
55
- attaching service projects to the Shared VPC host project
66
- assigning IAM roles for each Shared VPC subnet
77

8-
Full details on service project configuration can be found in the Google Cloud documentation on *[Provisioning Shared VPC](https://cloud.google.com/vpc/docs/provisioning-shared-vpc)*, and to *[Setting up clusters with Shared VPC](https://cloud.google.com/kubernetes-engine/docs/how-to/cluster-shared-vpc)*. Details and use cases of using service accounts as role recipients for Shared VPC are in the *[Service accounts as project admins](https://cloud.google.com/vpc/docs/provisioning-shared-vpc#sa-as-spa)* section of the first document above.
8+
Full details on service project configuration can be found in the Google Cloud documentation on *[Provisioning Shared VPC](https://cloud.google.com/vpc/docs/provisioning-shared-vpc)*, and to *[Setting up clusters with Shared VPC](https://cloud.google.com/kubernetes-engine/docs/how-to/cluster-shared-vpc)*. Details and use cases of using service accounts as role recipients for Shared VPC are in the *[Service accounts as project admins](https://cloud.google.com/vpc/docs/provisioning-shared-vpc#sa-as-spa)* section of the first document above.
99

1010
The resources created/managed by this module are:
1111

0 commit comments

Comments
 (0)