-
Notifications
You must be signed in to change notification settings - Fork 1
/
vnetvpngw.bicep
58 lines (53 loc) · 1.31 KB
/
vnetvpngw.bicep
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
50
51
52
53
54
55
56
57
58
param location string = resourceGroup().location
param vpngwpipname string
param vpngwname string
@description('Specifies the resource id of the subnet to connect the VM to.')
param subnetref string
@description('BGP AS-number to use for the VPN Gateway')
param asn int
resource vpngwpip 'Microsoft.Network/publicIPAddresses@2020-06-01' = {
name: vpngwpipname
location: location
sku: {
name: 'Standard'
}
properties: {
publicIPAllocationMethod: 'Static'
}
}
resource vpngw 'Microsoft.Network/virtualNetworkGateways@2020-06-01' = {
name: vpngwname
location: location
properties: {
gatewayType: 'Vpn'
ipConfigurations: [
{
name: 'default'
properties: {
privateIPAllocationMethod: 'Dynamic'
subnet: {
id: subnetref
}
publicIPAddress: {
id: vpngwpip.id
}
}
}
]
activeActive: false
enableBgp: true
bgpSettings: {
asn: asn
}
vpnType: 'RouteBased'
vpnGatewayGeneration: 'Generation1'
sku: {
name: 'VpnGw1AZ'
tier: 'VpnGw1AZ'
}
}
}
output id string = vpngw.id
output vpngwip string = vpngwpip.properties.ipAddress
output vpngwbgpaddress string = vpngw.properties.bgpSettings.bgpPeeringAddress
output bgpasn int = vpngw.properties.bgpSettings.asn