Note: The default ITS GitLab runner is a shared resource and is subject to slowdowns during heavy usage.
You can run your own GitLab runner that is dedicated just to your group if you need to avoid processing delays.

Commit d691c69d authored by Kenny Moore's avatar Kenny Moore
Browse files

Working with multiple tunnels

parent 333ff209
......@@ -105,33 +105,35 @@ resource "google_compute_router" "vpn_router" {
}
}
# resource "google_compute_router_interface" "bgp-interface" {
# # count = var.network && var.vpn ? 1:0 # if network and vpn are true, create resource
# count = var.vpn_tunnel_count
# name = "bgp-vpn-interface${count.index}" # should use var/count
# project = "${google_project.gcp_project.project_id}"
# router = "${google_compute_router.vpn_router.name}"
# region = var.regions[0] # need a var
# ip_range = var.vpn_connection_info["${count.index}"].value # need a var
# vpn_tunnel = "${google_compute_vpn_tunnel.vpn_tunnel.name}" # need to write for this to be multiple tunnels
# }
# resource "google_compute_vpn_tunnel" "vpn_tunnel" {
# count = var.network && var.vpn ? 1:0 # if network and vpn are true, create resource
# name = "bgp-vpn-tunnel1" # need a count
# project = "${google_project.gcp_project.project_id}"
# peer_ip = "${local.um_vpn_endpoint[0].ip}" # supply in var
# shared_secret = "$uper$ecretPa$$w0rd!" # from ENV?
# target_vpn_gateway = "${google_compute_vpn_gateway.vpn_gw["um_vpn"].self_link}"
# router = "${google_compute_router.vpn_router[0].self_link}"
# depends_on = [
# "google_compute_forwarding_rule.fr_esp",
# "google_compute_forwarding_rule.fr_udp500",
# "google_compute_forwarding_rule.fr_udp4500",
# ]
# }
### WORKING HERE ###
resource "google_compute_router_interface" "bgp-interface" {
count = length(var.bgp_network)
name = "bgp-vpn-interface${count.index}" # should use var/count
project = var.project_id
router = "${google_compute_router.vpn_router.name}"
region = var.regions[0] # need a var
# ip_range = var.vpn_connection_info["${count.index}"].value # need a var
ip_range = var.bgp_network[count.index] # need a var
vpn_tunnel = "${google_compute_vpn_tunnel.vpn_tunnel[count.index].name}" # need to write for this to be multiple tunnels
}
resource "google_compute_vpn_tunnel" "vpn_tunnel" {
# count = var.network && var.vpn ? 1:0 # if network and vpn are true, create resource
count = length(var.bgp_network)
name = "bgp-vpn-tunnel${count.index}" # need a count
project = var.project_id
peer_ip = local.um_vpn_endpoint[count.index].ip # supply in var
shared_secret = "$uper$ecretPa$$w0rd!" # from ENV?
# target_vpn_gateway = "${google_compute_vpn_gateway.vpn_gw["um_vpn"].self_link}"
target_vpn_gateway = "${google_compute_vpn_gateway.vpn_gw.self_link}"
router = "${google_compute_router.vpn_router.self_link}"
depends_on = [
"google_compute_forwarding_rule.fr_esp",
"google_compute_forwarding_rule.fr_udp500",
"google_compute_forwarding_rule.fr_udp4500",
]
}
### REFERENCE ###
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment