Files
hunfabric/networking/ilb-next-hop/vpc-left.tf
Ludovico Magnocavallo f62b9362a2 ILB for appliances example (#122)
* rename infrastructure folder to networking

* example WIP: VPCs

* move ip forwarding to its own variable in compute-vm module

* add per-instance metadata support to compute-vm module

* ipip tunnels on linux savepoint

* simple multinic gateways example

* remove stale files

* resolve conflicts

* update diagram

* rename folder

* use a template for gw cloud config, rename some resources and files

* Update README.md

* Update README.md

* add basic plan tests for all networking e2e examples

* fix test for foundations/environments e2e example

* fix shared vpc e2 example count error in gke node service account permissions

* use module path for assets in onprem e2e example

* use project id from module in ilb e2e example

* add mising boilerplates in tests

* run examples tests in ci

* update module's README

* rename ilb example

* Update README.md

* fix rp_filter configuration

* README

* Update README.md

* Update README.md

* Update README.md

* update CHANGELOG

* update CHANGELOG

* Update README.md
2020-08-15 10:12:43 +02:00

56 lines
1.7 KiB
HCL

/**
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
module "vpc-left" {
source = "../../modules/net-vpc"
project_id = module.project.project_id
name = "${local.prefix}left"
subnets = [
{
ip_cidr_range = var.ip_ranges.left
name = "${local.prefix}left"
region = var.region
secondary_ip_range = {}
},
]
routes = {
to-right = {
dest_range = var.ip_ranges.right
priority = null
tags = null
next_hop_type = "ilb"
next_hop = module.ilb-left.forwarding_rule.self_link
}
}
}
module "firewall-left" {
source = "../../modules/net-vpc-firewall"
project_id = module.project.project_id
network = module.vpc-left.name
admin_ranges_enabled = true
admin_ranges = values(var.ip_ranges)
ssh_source_ranges = ["35.235.240.0/20", "35.191.0.0/16", "130.211.0.0/22"]
}
module "nat-left" {
source = "../../modules/net-cloudnat"
project_id = module.project.project_id
region = var.region
name = "${local.prefix}left"
router_network = module.vpc-left.name
}