Skip to content

Instantly share code, notes, and snippets.

@rtrentin73
Last active April 20, 2022 18:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rtrentin73/d914a4b552de69284e9fe5851167f7b9 to your computer and use it in GitHub Desktop.
Save rtrentin73/d914a4b552de69284e9fe5851167f7b9 to your computer and use it in GitHub Desktop.
module "mc_transit" {
source = "terraform-aviatrix-modules/mc-transit/aviatrix"
version = "v2.0.0"
cloud = var.cloud
cidr = var.vpcs["firenet"]
region = var.region
account = var.account
enable_transit_firenet = true
enable_bgp_over_lan = var.bgpolan
insane_mode = var.insane
lan_cidr = var.vpcs["lan"]
bgp_lan_interfaces = [{
vpc_id = aviatrix_vpc.bgpolan.name
subnet = var.vpcs["bgpolan"]
}]
ha_bgp_lan_interfaces = [{
vpc_id = aviatrix_vpc.bgpolan-ha.name
subnet = var.vpcs["bgpolan-ha"]
}]
}
module "firenet_1" {
source = "terraform-aviatrix-modules/mc-firenet/aviatrix"
version = "1.0.0"
transit_module = module.mc_transit
firewall_image = var.firewall_image
firewall_image_version = var.firewall_image_version
#bootstrap_bucket_name_1 = var.storage_bucket_name
egress_cidr = var.vpcs["egress"]
egress_enabled = false
inspection_enabled = true
instance_size = var.instance_size
mgmt_cidr = var.vpcs["mgmt"]
password = var.password
}
module "mc-spoke" {
for_each = {
"spoke30" = "spoke50"
"spoke40" = "spoke60"
}
source = "terraform-aviatrix-modules/mc-spoke/aviatrix"
version = "1.1.2"
account = var.account
cloud = var.cloud
name = "gcp-${each.value}-${var.region}"
region = var.region
cidr = var.vpcs["${each.value}"]
inspection = true
transit_gw = module.mc_transit.transit_gateway.gw_name
ha_gw = true
instance_size = var.instance_size
single_az_ha = false
insane_mode = var.insane
}
resource "aviatrix_vpc" "bgpolan" {
cloud_type = 4
account_name = var.account
name = "gcp-bgpolan-${var.region}"
subnets {
name = "gcp-bgpolan-${var.region}"
region = var.region
cidr = var.vpcs["bgpolan"]
}
}
resource "aviatrix_vpc" "bgpolan-ha" {
cloud_type = 4
account_name = var.account
name = "gcp-bgpolan-ha-${var.region}"
subnets {
name = "gcp-bgpolan-ha-${var.region}"
region = var.region
cidr = var.vpcs["bgpolan-ha"]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment