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 0b7ae9b5 authored by Kenny Moore's avatar Kenny Moore
Browse files

VPN config working - not tested with NSO

parent d691c69d
......@@ -105,7 +105,6 @@ resource "google_compute_router" "vpn_router" {
}
}
### WORKING HERE ###
resource "google_compute_router_interface" "bgp-interface" {
count = length(var.bgp_network)
name = "bgp-vpn-interface${count.index}" # should use var/count
......@@ -117,14 +116,12 @@ resource "google_compute_router_interface" "bgp-interface" {
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
resource "google_compute_vpn_tunnel" "vpn_tunnel" {
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}"
shared_secret = var.VPN_PASSWORD
target_vpn_gateway = "${google_compute_vpn_gateway.vpn_gw.self_link}"
router = "${google_compute_router.vpn_router.self_link}"
......@@ -133,20 +130,4 @@ resource "google_compute_vpn_tunnel" "vpn_tunnel" {
"google_compute_forwarding_rule.fr_udp500",
"google_compute_forwarding_rule.fr_udp4500",
]
}
### REFERENCE ###
## ## ## Working, but I was wrong - only need one ASN for the router; need multiple networks for the Interfaces
# resource "google_compute_router" "vpn_router" {
# name = "vpn-router"
# project = var.project_id
# network = google_compute_network.vpn_vpc.self_link
# region = var.regions[0]
# dynamic "bgp" {
# for_each = var.vpn_connection_info
# content {
# asn = bgp.value.asn
# }
# }
# }
\ No newline at end of file
}
\ No newline at end of file
......@@ -26,6 +26,10 @@ variable "project_id" {
variable "prefix" {
}
variable "VPN_PASSWORD" {
}
# variable "vpn_connection_info" {
# default = [{}]
# }
\ No newline at end of file
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