Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for dual stack and multiple forwarding rules to net-lb-int module #1765

Merged
merged 5 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion blueprints/data-solutions/sqlserver-alwayson/vpc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,11 @@ module "listener-ilb" {
region = var.region
name = "${var.prefix}-${each.value}-ilb"
service_label = "${var.prefix}-${each.value}-ilb"
address = local.internal_address_ips["${var.prefix}-lb-${each.value}"]
forwarding_rules_config = {
default = {
ip_address = local.internal_address_ips["${var.prefix}-lb-${each.value}"]
}
}
vpc_config = {
network = local.network
subnetwork = local.subnetwork
Expand Down
6 changes: 5 additions & 1 deletion blueprints/networking/filtering-proxy-psc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,12 @@ module "squid-ilb" {
project_id = module.project.project_id
region = var.region
name = "squid-ilb"
ports = [3128]
service_label = "squid-ilb"
forwarding_rules_config = {
default = {
ports = [3128]
}
}
vpc_config = {
network = module.vpc.self_link
subnetwork = module.vpc.subnet_self_links["${var.region}/proxy"]
Expand Down
8 changes: 6 additions & 2 deletions blueprints/networking/filtering-proxy/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
locals {
squid_address = (
var.mig
? module.squid-ilb.0.forwarding_rule_address
? module.squid-ilb.0.forwarding_rule_addresses["default"]
: module.squid-vm.internal_ip
)
}
Expand Down Expand Up @@ -210,8 +210,12 @@ module "squid-ilb" {
project_id = module.project-host.project_id
region = var.region
name = "squid-ilb"
ports = [3128]
service_label = "squid-ilb"
forwarding_rules_config = {
default = {
ports = [3128]
}
}
vpc_config = {
network = module.vpc.self_link
subnetwork = module.vpc.subnet_self_links["${var.region}/proxy"]
Expand Down
4 changes: 2 additions & 2 deletions blueprints/networking/glb-hybrid-neg-internal/glb.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module "hybrid-glb" {
endpoints = {
primary = {
ip_address = (var.ilb_create
? module.test_vm_ilbs["primary"].forwarding_rule_address
? module.test_vm_ilbs["primary"].forwarding_rule_addresses["default"]
: module.test_vms["primary"].internal_ip
)
port = 80
Expand All @@ -59,7 +59,7 @@ module "hybrid-glb" {
endpoints = {
secondary = {
ip_address = (var.ilb_create
? module.test_vm_ilbs["secondary"].forwarding_rule_address
? module.test_vm_ilbs["secondary"].forwarding_rule_addresses["default"]
: module.test_vms["secondary"].internal_ip
)
port = 80
Expand Down
12 changes: 10 additions & 2 deletions blueprints/networking/ilb-next-hop/gateways.tf
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ module "ilb-left" {
network = module.vpc-left.self_link
subnetwork = values(module.vpc-left.subnet_self_links)[0]
}
address = local.addresses.ilb-left
forwarding_rules_config = {
default = {
address = local.addresses.ilb-left
}
}
backend_service_config = {
session_affinity = var.ilb_session_affinity
}
Expand All @@ -91,7 +95,11 @@ module "ilb-right" {
network = module.vpc-right.self_link
subnetwork = values(module.vpc-right.subnet_self_links)[0]
}
address = local.addresses.ilb-right
forwarding_rules_config = {
default = {
address = local.addresses.ilb-right
}
}
backend_service_config = {
session_affinity = var.ilb_session_affinity
}
Expand Down
4 changes: 2 additions & 2 deletions blueprints/networking/ilb-next-hop/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ output "addresses" {
description = "IP addresses."
value = {
gw = [for z, mod in module.gw : mod.internal_ip]
ilb-left = module.ilb-left.forwarding_rule_address
ilb-right = module.ilb-right.forwarding_rule_address
ilb-left = module.ilb-left.forwarding_rule_addresses["default"]
ilb-right = module.ilb-right.forwarding_rule_addresses["default"]
vm-left = [for z, mod in module.vm-left : mod.internal_ip]
vm-right = [for z, mod in module.vm-right : mod.internal_ip]
}
Expand Down
12 changes: 10 additions & 2 deletions fast/stages/2-networking-c-nva/nva.tf
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,11 @@ module "ilb-nva-untrusted" {
region = each.value.region
name = "nva-untrusted-${each.key}"
service_label = var.prefix
global_access = true
forwarding_rules_config = {
default = {
global_access = true
}
}
vpc_config = {
network = module.landing-untrusted-vpc.self_link
subnetwork = module.landing-untrusted-vpc.subnet_self_links[each.value.subnet]
Expand Down Expand Up @@ -160,7 +164,11 @@ module "ilb-nva-trusted" {
region = each.value.region
name = "nva-trusted-${each.key}"
service_label = var.prefix
global_access = true
forwarding_rules_config = {
default = {
global_access = true
}
}
vpc_config = {
network = module.landing-trusted-vpc.self_link
subnetwork = module.landing-trusted-vpc.subnet_self_links[each.value.subnet]
Expand Down
8 changes: 4 additions & 4 deletions fast/stages/2-networking-c-nva/spoke-dev.tf
Original file line number Diff line number Diff line change
Expand Up @@ -65,28 +65,28 @@ module "dev-spoke-vpc" {
priority = 1000
tags = ["primary"]
next_hop_type = "ilb"
next_hop = module.ilb-nva-trusted["primary"].forwarding_rule_address
next_hop = module.ilb-nva-trusted["primary"].forwarding_rule_addresses["default"]
}
nva-secondary-to-secondary = {
dest_range = "0.0.0.0/0"
priority = 1000
tags = ["secondary"]
next_hop_type = "ilb"
next_hop = module.ilb-nva-trusted["secondary"].forwarding_rule_address
next_hop = module.ilb-nva-trusted["secondary"].forwarding_rule_addresses["default"]
}
nva-primary-to-secondary = {
dest_range = "0.0.0.0/0"
priority = 1001
tags = ["primary"]
next_hop_type = "ilb"
next_hop = module.ilb-nva-trusted["primary"].forwarding_rule_address
next_hop = module.ilb-nva-trusted["primary"].forwarding_rule_addresses["default"]
}
nva-secondary-to-primary = {
dest_range = "0.0.0.0/0"
priority = 1001
tags = ["secondary"]
next_hop_type = "ilb"
next_hop = module.ilb-nva-trusted["secondary"].forwarding_rule_address
next_hop = module.ilb-nva-trusted["secondary"].forwarding_rule_addresses["default"]
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions fast/stages/2-networking-c-nva/spoke-prod.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,28 +64,28 @@ module "prod-spoke-vpc" {
priority = 1000
tags = ["primary"]
next_hop_type = "ilb"
next_hop = module.ilb-nva-trusted["primary"].forwarding_rule_address
next_hop = module.ilb-nva-trusted["primary"].forwarding_rule_addresses["default"]
}
nva-secondary-to-secondary = {
dest_range = "0.0.0.0/0"
priority = 1000
tags = ["secondary"]
next_hop_type = "ilb"
next_hop = module.ilb-nva-trusted["secondary"].forwarding_rule_address
next_hop = module.ilb-nva-trusted["secondary"].forwarding_rule_addresses["default"]
}
nva-primary-to-secondary = {
dest_range = "0.0.0.0/0"
priority = 1001
tags = ["primary"]
next_hop_type = "ilb"
next_hop = module.ilb-nva-trusted["secondary"].forwarding_rule_address
next_hop = module.ilb-nva-trusted["secondary"].forwarding_rule_addresses["default"]
}
nva-secondary-to-primary = {
dest_range = "0.0.0.0/0"
priority = 1001
tags = ["secondary"]
next_hop_type = "ilb"
next_hop = module.ilb-nva-trusted["primary"].forwarding_rule_address
next_hop = module.ilb-nva-trusted["primary"].forwarding_rule_addresses["default"]
}
}
}
Expand Down
Loading
Loading