forked from dmauser/AzureVM-Router
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLinuxRouter.json
192 lines (192 loc) · 5.63 KB
/
LinuxRouter.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"virtualMachineSize": {
"type": "string",
"defaultValue": "Standard_B2s",
"allowedValues":[
"Standard_A1_v2",
"Standard_A2_v2",
"Standard_A4_v2",
"Standard_B1s",
"Standard_B1ms",
"Standard_B2s",
"Standard_B2ms",
"Standard_B4ms",
"Standard_F1s",
"Standard_F2s",
"Standard_F4s",
"Standard_DS1_v2"
],
"metadata": {
"description": "VM size"
}
},
"virtualMachineName": {
"type": "string",
"metadata": {
"description": "Linux Router Manchine Name"
}
},
"osDiskType": {
"type": "string",
"defaultValue": "Standard_LRS",
"allowedValues": [
"Standard_LRS",
"StandardSSD_LRS",
"Premium_LRS"
],
"metadata": {
"description": "Select Disk Type: Premium SSD (Premium_LRS), Standard SSD (StandardSSD_LRS), Standard HDD (Standard_LRS)"
}
},
"adminUsername": {
"type": "string",
"metadata": {
"description": "Admin username"
}
},
"adminPassword": {
"type": "securestring",
"metadata": {
"description": "Admin password"
}
},
"existingVirtualNetworkName": {
"type": "string",
"metadata": {
"description": "Existing Virtual Nework Name"
}
},
"existingSubnet": {
"type": "string",
"metadata": {
"description": "Type Existing Subnet Name"
}
},
"scriptUri": {
"defaultValue": "[uri(deployment().properties.templateLink.uri, 'LinuxRouter.sh')]",
"type": "string",
"metadata": { "description": "Script that will be executed" }
},
"scriptCmd": {
"defaultValue": "sh LinuxRouter.sh",
"type": "string",
"metadata": { "description": "Command to run the script" }
}
},
"variables": {
"extensionName":"CustomScript",
"NIC": "[concat(parameters('virtualMachineName'),'-NIC')]",
"publicIPAddressName": "[concat(parameters('virtualMachineName'),'-PublicIP')]",
"subnet1Ref": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('existingVirtualNetworkName'), parameters('existingSubnet'))]",
"location": "[resourceGroup().location]"
},
"resources": [
{
"name": "[parameters('virtualMachineName')]",
"type": "Microsoft.Compute/virtualMachines",
"apiVersion": "2017-03-30",
"location": "[variables('location')]",
"comments": "This is the virtual machine that you're building.",
"dependsOn": [
"[variables('NIC')]"
],
"properties": {
"osProfile": {
"computerName": "[parameters('virtualMachineName')]",
"adminUsername": "[parameters('adminUsername')]",
"adminPassword": "[parameters('adminPassword')]"
},
"hardwareProfile": {
"vmSize": "[parameters('virtualMachineSize')]"
},
"storageProfile": {
"imageReference": {
"publisher": "Canonical",
"offer": "UbuntuServer",
"sku": "18.04-LTS",
"version": "latest"
},
"osDisk": {
"createOption": "FromImage",
"managedDisk": {
"storageAccountType": "[parameters('osDiskType')]"
}
},
"dataDisks": []
},
"networkProfile": {
"networkInterfaces": [
{
"properties": {
"primary": true
},
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('NIC'))]"
}
]
}
}
},
{
"name": "[variables('NIC')]",
"type": "Microsoft.Network/networkInterfaces",
"apiVersion": "2017-06-01",
"location": "[variables('location')]",
"comments": "This will be your Primary NIC Untrusted",
"dependsOn": [
"[variables('publicIpAddressName')]"
],
"properties": {
"enableIPForwarding": true,
"ipConfigurations": [
{
"name": "ipconfig1",
"properties": {
"subnet": {
"id": "[variables('subnet1Ref')]"
},
"privateIPAllocationMethod": "Dynamic",
"publicIpAddress": {
"id": "[resourceId('Microsoft.Network/publicIpAddresses', variables('publicIpAddressName'))]"
}
}
}
]
}
},
{
"name": "[variables('publicIpAddressName')]",
"type": "Microsoft.Network/publicIPAddresses",
"apiVersion": "2017-06-01",
"location": "[variables('location')]",
"comments": "Public IP for your Primary NIC",
"properties": {
"publicIPAllocationMethod": "Dynamic"
}
},
{
"type": "Microsoft.Compute/virtualMachines/extensions",
"name": "[concat(parameters('virtualMachineName'), '/', variables('extensionName'))]",
"apiVersion": "2015-06-15",
"location": "[variables('location')]",
"dependsOn": [
"[concat('Microsoft.Compute/virtualMachines/', parameters('virtualMachineName'))]"
],
"properties": {
"publisher": "Microsoft.Azure.Extensions",
"type": "CustomScript",
"typeHandlerVersion": "2.0",
"autoUpgradeMinorVersion": true,
"settings": {
"fileUris": [
"[parameters('scriptUri')]"
],
"commandToExecute": "[parameters('scriptCmd')]"
}
}
}
],
"outputs": {}
}