Skip to content

Instantly share code, notes, and snippets.

@rtrentinavx
Last active September 15, 2022 17:18
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 rtrentinavx/a421c529a397dbfb16847767ab7b9584 to your computer and use it in GitHub Desktop.
Save rtrentinavx/a421c529a397dbfb16847767ab7b9584 to your computer and use it in GitHub Desktop.
resource "aviatrix_site2cloud" "site2cloud_connection-east" {
depends_on = [
aviatrix_gateway.aviatrix_gateway_standalone-east
]
count = var.region_active == "east" ? 1 : 0
vpc_id = aviatrix_gateway.aviatrix_gateway_standalone-east.vpc_id
connection_name = "${aviatrix_gateway.aviatrix_gateway_standalone-east.id}-${var.region_active}-${replace("${var.remote_gateway_ip}", ".", "-")}"
connection_type = "mapped"
remote_gateway_type = "generic"
tunnel_type = "route"
pre_shared_key = var.pre_shared_key
enable_ikev2 = true
primary_cloud_gateway_name = aviatrix_gateway.aviatrix_gateway_standalone-east.gw_name
remote_gateway_ip = var.remote_gateway_ip
custom_mapped = false
remote_subnet_cidr = var.remote_subnet_cidr
remote_subnet_virtual = var.remote_virtual
local_subnet_cidr = aviatrix_vpc.azure_vnet_user-spoke-east-2.cidr
#local_subnet_virtual = var.cloud_virtual
enable_single_ip_ha = true
backup_gateway_name = aviatrix_gateway.aviatrix_gateway_standalone-east.peering_ha_gw_name
ha_enabled = true
backup_remote_gateway_ip = var.remote_gateway_ip
backup_pre_shared_key = var.pre_shared_key
}
resource "aviatrix_site2cloud" "site2cloud_connection-west" {
depends_on = [
aviatrix_gateway.aviatrix_gateway_standalone-west
]
count = var.region_active == "west" ? 1 : 0
vpc_id = aviatrix_gateway.aviatrix_gateway_standalone-west.vpc_id
connection_name = "${aviatrix_gateway.aviatrix_gateway_standalone-west.id}-${var.region_active}-${replace("${var.remote_gateway_ip}", ".", "-")}"
connection_type = "unmapped"
remote_gateway_type = "generic"
tunnel_type = "route"
pre_shared_key = var.pre_shared_key
enable_ikev2 = true
primary_cloud_gateway_name = aviatrix_gateway.aviatrix_gateway_standalone-west.gw_name
remote_gateway_ip = var.remote_gateway_ip
custom_mapped = false
remote_subnet_cidr = var.remote_subnet_cidr
#remote_subnet_virtual = var.remote_virtual
local_subnet_cidr = aviatrix_vpc.azure_vnet_user-spoke-west-2.cidr
#local_subnet_virtual = var.cloud_virtual
enable_single_ip_ha = true
backup_gateway_name = aviatrix_gateway.aviatrix_gateway_standalone-west.peering_ha_gw_name
ha_enabled = true
backup_remote_gateway_ip = var.remote_gateway_ip
backup_pre_shared_key = var.pre_shared_key
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment