/
connections.json
67 lines (67 loc) · 2.91 KB
/
connections.json
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
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"connectionSettings": {
"type": "secureObject"
},
"location_1": {
"type": "string"
},
"location_2": {
"type": "string"
},
"suffix": {
"type": "string"
},
"suffix2": {
"type": "string"
}
},
"variables": {
"conName1": "[concat(parameters('location_1'),'-',parameters('suffix'),'-to-',parameters('location_2'),'-',parameters('suffix2'))]",
"conName2": "[concat(parameters('location_2'),'-',parameters('suffix2'),'-to-',parameters('location_1'),'-',parameters('suffix'))]",
"apiVersion": "[parameters('connectionSettings').apiVersion]",
"location_1": "[parameters('location_1')]",
"location_2": "[parameters('location_2')]",
"VPNSharedKey": "[parameters('connectionSettings').VPNSharedKey]",
"gatewayNameReg1": "[concat(parameters('connectionSettings').gatewayNameReg,'-',parameters('location_1'),'-',parameters('suffix'))]",
"gatewayNameReg2": "[concat(parameters('connectionSettings').gatewayNameReg,'-',parameters('location_2'),'-',parameters('suffix2'))]"
},
"resources": [
{
"name": "[variables('conName1')]",
"type": "Microsoft.Network/connections",
"apiVersion": "[variables('apiVersion')]",
"location": "[variables('location_1')]",
"properties": {
"publicIPAllocationMethod": "Dynamic",
"virtualNetworkGateway1": {
"id": "[resourceId('Microsoft.Network/virtualNetworkGateways', variables('gatewayNameReg1'))]"
},
"virtualNetworkGateway2": {
"id": "[resourceId('Microsoft.Network/virtualNetworkGateways', variables('gatewayNameReg2'))]"
},
"connectionType": "Vnet2Vnet",
"sharedKey": "[variables('VPNSharedKey')]"
}
},
{
"name": "[variables('conName2')]",
"type": "Microsoft.Network/connections",
"apiVersion": "2016-03-30",
"location": "[variables('location_2')]",
"properties": {
"publicIPAllocationMethod": "Dynamic",
"virtualNetworkGateway1": {
"id": "[resourceId('Microsoft.Network/virtualNetworkGateways', variables('gatewayNameReg2'))]"
},
"virtualNetworkGateway2": {
"id": "[resourceId('Microsoft.Network/virtualNetworkGateways', variables('gatewayNameReg1'))]"
},
"connectionType": "Vnet2Vnet",
"sharedKey": "[variables('VPNSharedKey')]"
}
}
]
}