-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathVpnConnections.bicep
75 lines (67 loc) · 1.9 KB
/
VpnConnections.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
targetScope = 'subscription'
param location string
@secure()
param sharedKey string
param enableBgp bool
param tagsByResource object
//OnPrem
param OnPremGatewayID string
param OnPremRgName string
param OnPremBgpAsn int
param OnPremBgpPeeringAddress string
param HubGatewayPublicIP string
param HubLocalGatewayName string
param HubAddressPrefixes array
//Hub
param HubGatewayID string
param HubRgName string
param HubBgpAsn int
param HubBgpPeeringAddress string
param OnPremGatewayPublicIP string
param OnPremLocalGatewayName string
param OnPremAddressPrefixes array
// subscriptions
param hubSubscriptionID string
param onPremSubscriptionID string
resource onpremrg 'Microsoft.Resources/resourceGroups@2023-07-01' existing = {
scope: subscription(onPremSubscriptionID)
name: OnPremRgName
}
module onprem2hub 'modules/vpnconnection.bicep' = {
scope: onpremrg
name: HubLocalGatewayName
params: {
LocalGatewayAddressPrefixes: HubAddressPrefixes
LocalGatewayName: HubLocalGatewayName
LocalGatewayPublicIP: HubGatewayPublicIP
location: location
connectionName: 'VPNtoHub'
sharedKey: sharedKey
VpnGatewayID: OnPremGatewayID
tagsByResource: tagsByResource
enableBgp: enableBgp
BgpAsn: HubBgpAsn
BgpPeeringAddress: HubBgpPeeringAddress
}
}
resource hubrg 'Microsoft.Resources/resourceGroups@2023-07-01' existing = {
scope: subscription(hubSubscriptionID)
name: HubRgName
}
module hub2onprem 'modules/vpnconnection.bicep' = {
scope: hubrg
name: OnPremLocalGatewayName
params: {
LocalGatewayAddressPrefixes: OnPremAddressPrefixes
LocalGatewayName: OnPremLocalGatewayName
LocalGatewayPublicIP: OnPremGatewayPublicIP
location: location
connectionName: 'VPNtoOnPrem'
sharedKey: sharedKey
VpnGatewayID: HubGatewayID
tagsByResource: tagsByResource
enableBgp: enableBgp
BgpAsn: OnPremBgpAsn
BgpPeeringAddress: OnPremBgpPeeringAddress
}
}