Skip to content

Commit

Permalink
Rename to create_googleapis_routes
Browse files Browse the repository at this point in the history
  • Loading branch information
juliocc committed May 26, 2023
1 parent cecbd20 commit 0888cce
Show file tree
Hide file tree
Showing 17 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion fast/stages/2-networking-a-peering/landing.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ module "landing-vpc" {
inbound = true
}
# set explicit routes for googleapis in case the default route is deleted
create_default_routes = {
create_googleapis_routes = {
private = true
restricted = true
}
Expand Down
2 changes: 1 addition & 1 deletion fast/stages/2-networking-a-peering/spoke-dev.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ module "dev-spoke-vpc" {
data_folder = "${var.factories_config.data_dir}/subnets/dev"
psa_config = try(var.psa_ranges.dev, null)
# set explicit routes for googleapis in case the default route is deleted
create_default_routes = {
create_googleapis_routes = {
private = true
restricted = true
}
Expand Down
2 changes: 1 addition & 1 deletion fast/stages/2-networking-a-peering/spoke-prod.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ module "prod-spoke-vpc" {
data_folder = "${var.factories_config.data_dir}/subnets/prod"
psa_config = try(var.psa_ranges.prod, null)
# set explicit routes for googleapis in case the default route is deleted
create_default_routes = {
create_googleapis_routes = {
private = true
restricted = true
}
Expand Down
2 changes: 1 addition & 1 deletion fast/stages/2-networking-b-vpn/landing.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ module "landing-vpc" {
inbound = true
}
# set explicit routes for googleapis in case the default route is deleted
create_default_routes = {
create_googleapis_routes = {
private = true
restricted = true
}
Expand Down
2 changes: 1 addition & 1 deletion fast/stages/2-networking-b-vpn/spoke-dev.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ module "dev-spoke-vpc" {
data_folder = "${var.factories_config.data_dir}/subnets/dev"
psa_config = try(var.psa_ranges.dev, null)
# set explicit routes for googleapis in case the default route is deleted
create_default_routes = {
create_googleapis_routes = {
private = true
restricted = true
}
Expand Down
2 changes: 1 addition & 1 deletion fast/stages/2-networking-b-vpn/spoke-prod.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ module "prod-spoke-vpc" {
data_folder = "${var.factories_config.data_dir}/subnets/prod"
psa_config = try(var.psa_ranges.prod, null)
# set explicit routes for googleapis in case the default route is deleted
create_default_routes = {
create_googleapis_routes = {
private = true
restricted = true
}
Expand Down
2 changes: 1 addition & 1 deletion fast/stages/2-networking-c-nva/landing.tf
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ module "landing-trusted-vpc" {
inbound = true
}
# Set explicit routes for googleapis in case the default route is deleted
create_default_routes = {
create_googleapis_routes = {
private = true
restricted = true
}
Expand Down
2 changes: 1 addition & 1 deletion fast/stages/2-networking-c-nva/spoke-dev.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ module "dev-spoke-vpc" {
delete_default_routes_on_create = true
psa_config = try(var.psa_ranges.dev, null)
# Set explicit routes for googleapis; send everything else to NVAs
create_default_routes = {
create_googleapis_routes = {
private = true
restricted = true
}
Expand Down
2 changes: 1 addition & 1 deletion fast/stages/2-networking-c-nva/spoke-prod.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ module "prod-spoke-vpc" {
delete_default_routes_on_create = true
psa_config = try(var.psa_ranges.prod, null)
# Set explicit routes for googleapis; send everything else to NVAs
create_default_routes = {
create_googleapis_routes = {
private = true
restricted = true
}
Expand Down
2 changes: 1 addition & 1 deletion fast/stages/2-networking-d-separate-envs/spoke-dev.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ module "dev-spoke-vpc" {
data_folder = "${var.factories_config.data_dir}/subnets/dev"
psa_config = try(var.psa_ranges.dev, null)
# set explicit routes for googleapis in case the default route is deleted
create_default_routes = {
create_googleapis_routes = {
private = true
restricted = true
}
Expand Down
2 changes: 1 addition & 1 deletion fast/stages/2-networking-d-separate-envs/spoke-prod.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ module "prod-spoke-vpc" {
data_folder = "${var.factories_config.data_dir}/subnets/prod"
psa_config = try(var.psa_ranges.prod, null)
# set explicit routes for googleapis in case the default route is deleted
create_default_routes = {
create_googleapis_routes = {
private = true
restricted = true
}
Expand Down
2 changes: 1 addition & 1 deletion fast/stages/2-networking-e-nva-bgp/landing.tf
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ module "landing-trusted-vpc" {
inbound = true
}
# Set explicit routes for googleapis in case the default route is deleted
create_default_routes = {
create_googleapis_routes = {
private = true
restricted = true
}
Expand Down
2 changes: 1 addition & 1 deletion fast/stages/2-networking-e-nva-bgp/spoke-dev.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ module "dev-spoke-vpc" {
delete_default_routes_on_create = true
psa_config = try(var.psa_ranges.dev, null)
# Set explicit routes for googleapis; send everything else to NVAs
create_default_routes = {
create_googleapis_routes = {
private = true
restricted = true
}
Expand Down
2 changes: 1 addition & 1 deletion fast/stages/2-networking-e-nva-bgp/spoke-prod.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ module "prod-spoke-vpc" {
delete_default_routes_on_create = true
psa_config = try(var.psa_ranges.prod, null)
# Set explicit routes for googleapis; send everything else to NVAs
create_default_routes = {
create_googleapis_routes = {
private = true
restricted = true
}
Expand Down
8 changes: 4 additions & 4 deletions modules/net-vpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ module "vpc" {
next_hop = "global/gateways/default-internet-gateway"
}
}
create_default_routes = {
create_googleapis_routes = {
restricted = false
restricted-6 = false
private = false
Expand All @@ -434,14 +434,14 @@ module "vpc" {

### Private Google Access routes

By default the VPC module creates IPv4 routes for the [Private Google Access ranges](https://cloud.google.com/vpc/docs/configure-private-google-access#config-routing). This behavior can be controlled through the `create_default_routes` variable:
By default the VPC module creates IPv4 routes for the [Private Google Access ranges](https://cloud.google.com/vpc/docs/configure-private-google-access#config-routing). This behavior can be controlled through the `create_googleapis_routes` variable:

```hcl
module "vpc" {
source = "./fabric/modules/net-vpc"
project_id = "my-project"
name = "my-vpc"
create_default_routes = {
create_googleapis_routes = {
restricted = false
restricted-6 = true
private = false
Expand Down Expand Up @@ -488,7 +488,7 @@ module "vpc" {
| [name](variables.tf#L84) | The name of the network being created. | <code>string</code> || |
| [project_id](variables.tf#L100) | The ID of the project where this VPC will be created. | <code>string</code> || |
| [auto_create_subnetworks](variables.tf#L17) | Set to true to create an auto mode subnet, defaults to custom mode. | <code>bool</code> | | <code>false</code> |
| [create_default_routes](variables.tf#L23) | Toggle creation of googleapis private/restricted routes. | <code title="object&#40;&#123;&#10; private &#61; optional&#40;bool, true&#41;&#10; private-6 &#61; optional&#40;bool, false&#41;&#10; restricted &#61; optional&#40;bool, true&#41;&#10; restricted-6 &#61; optional&#40;bool, false&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
| [create_googleapis_routes](variables.tf#L23) | Toggle creation of googleapis private/restricted routes. | <code title="object&#40;&#123;&#10; private &#61; optional&#40;bool, true&#41;&#10; private-6 &#61; optional&#40;bool, false&#41;&#10; restricted &#61; optional&#40;bool, true&#41;&#10; restricted-6 &#61; optional&#40;bool, false&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
| [data_folder](variables.tf#L35) | An optional folder containing the subnet configurations in YaML format. | <code>string</code> | | <code>null</code> |
| [delete_default_routes_on_create](variables.tf#L41) | Set to true to delete the default routes at creation time. | <code>bool</code> | | <code>false</code> |
| [description](variables.tf#L47) | An optional description of this resource (triggers recreation on change). | <code>string</code> | | <code>&#34;Terraform-managed.&#34;</code> |
Expand Down
2 changes: 1 addition & 1 deletion modules/net-vpc/routes.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ locals {
priority = 1000
tags = null
}
if var.create_default_routes[k]
if var.create_googleapis_routes[k]
}
_routes = merge(local._googleapis_routes, coalesce(var.routes, {}))
routes = {
Expand Down
2 changes: 1 addition & 1 deletion modules/net-vpc/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ variable "auto_create_subnetworks" {
default = false
}

variable "create_default_routes" {
variable "create_googleapis_routes" {
description = "Toggle creation of googleapis private/restricted routes."
type = object({
private = optional(bool, true)
Expand Down

0 comments on commit 0888cce

Please sign in to comment.