-
Notifications
You must be signed in to change notification settings - Fork 55
/
vnet-gw.tf
49 lines (44 loc) · 1.86 KB
/
vnet-gw.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#######################################################################
## Create VNET Gateway - onprem
#######################################################################
resource "azurerm_public_ip" "vnet-gw-onprem-pubip-1" {
name = "vnet-gw-onprem-pubip-1"
location = var.location-onprem
resource_group_name = azurerm_resource_group.vwan-microhack-spoke-rg.name
allocation_method = "Static"
sku = "Standard"
zones = ["1","2","3"]
}
resource "azurerm_public_ip" "vnet-gw-onprem-pubip-2" {
name = "vnet-gw-onprem-pubip-2"
location = var.location-onprem
resource_group_name = azurerm_resource_group.vwan-microhack-spoke-rg.name
allocation_method = "Static"
sku = "Standard"
zones = ["1","2","3"]
}
resource "azurerm_virtual_network_gateway" "vnet-gw-onprem" {
name = "vnet-gw-onprem"
location = var.location-onprem
resource_group_name = azurerm_resource_group.vwan-microhack-spoke-rg.name
type = "Vpn"
vpn_type = "RouteBased"
active_active = true
enable_bgp = true
sku = "VpnGw1AZ"
bgp_settings{
asn = 64000
}
ip_configuration {
name = "vnet-gw-onprem-ip-config-1"
public_ip_address_id = azurerm_public_ip.vnet-gw-onprem-pubip-1.id
private_ip_address_allocation = "Dynamic"
subnet_id = azurerm_subnet.onprem-gateway-subnet.id
}
ip_configuration {
name = "vnet-gw-onprem-ip-config-2"
public_ip_address_id = azurerm_public_ip.vnet-gw-onprem-pubip-2.id
private_ip_address_allocation = "Dynamic"
subnet_id = azurerm_subnet.onprem-gateway-subnet.id
}
}