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

corrected variables; working router config

parent 00eb7094
......@@ -97,48 +97,32 @@ resource "google_compute_vpn_gateway" "vpn_gw" {
# ip_address = "${google_compute_address.vpn_gw_ip.address}"
# target = "${google_compute_vpn_gateway.vpn_gw.self_link}"
# }
# resource "google_compute_router" "vpn_router" {
# # # count = var.network && var.vpn ? 1:0 # if network and vpn are true, create resource
# name = "${var.prefix}-bgp-vpn-router1" # should do this with a count?
# # project = var.project_id
# network = google_compute_network.vpn_vpc.self_link
# # region = var.regions[0]
# bpg {
# # asn = var.vpn_connection_info.value
# asn = "4200012098"
# }
# }
resource "google_compute_router" "vpn_router" {
name = "temp-router"
name = "${var.prefix}-bgp-vpn-router"
project = var.project_id
network = google_compute_network.vpn_vpc.self_link
region = var.regions[0]
bgp {
asn = var.vpn_connection_info[0].asn
asn = var.cloud_asn
}
}
# count = vpn_tunnel_count
# dynamic "bgp" {
# for_each = range(count(var.vpn_connection_info)
# content {
# asn = each.value
# }
# #
# # asn = local.um_vpn_endpoint[0].asn # going to need a count for this if we have multiple tunnels
# # content {
# # asn = var.vpn_connection_info[count.index].asn # from NetBox/variable - This is the GCP ASN
# # }
# # leave basically empty to take default (non-custom)
# # advertise_mode = DEFAULT
# # advertised_groups = ["ALL_SUBNETS"]
# # advertised_ip_ranges {
# # range = # from cidr subnetting
# # }
# }
## ## ## 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
# }
# }
# }
# 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
......
......@@ -12,12 +12,20 @@ variable "network_size" {
default = 256
}
variable "vpn_connection_info" {
default = [{}]
variable "bgp_network" {
default = []
}
variable "cloud_asn" {
default = ""
}
variable "project_id" {
}
variable "prefix" {
}
\ No newline at end of file
}
# 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