elasticsearch-secure/azuredeploy.json

raw link view readme
1
2 {
3 "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
4 "contentVersion": "1.0.0.0",
5 "parameters": {
6 "admin-username": {
7 "type": "string"
8 },
9 "ssh-public-key": {
10 "type": "string"
11 }
12 },
13 "variables": {
14 "ssh-keypath": "[concat('/home/', parameters('admin-username'), '/.ssh/authorized_keys')]",
15 "unique-prefix": "[concat(replace(resourceGroup().name,'-',''), substring(uniquestring(resourceGroup().name), 0, 5))]",
16 "storage-name": "[variables('unique-prefix')]",
17 "vnet-name": "[concat(resourceGroup().name, '-vnet')]",
18 "ip-prefix": "[concat(resourceGroup().name, '-ip-')]",
19 "nsg-prefix": "[concat(resourceGroup().name, '-nsg-')]",
20 "vm-prefix": "[concat(resourceGroup().name, '-vm-')]",
21 "nic-prefix": "[concat(resourceGroup().name, '-nic-')]",
22 "names": [ "alpha", "beta", "gamma", "delta", "epsilon", "zeta", "eta", "theta", "iota", "kappa", "lambda", "mu", "nu", "xi", "omicron", "pi", "rho", "sigma", "tau", "upsilon", "phi", "chi", "psi", "omega" ],
23 "vm-size": "Standard_DS1_v2",
24 "vnet-address-space": "10.16.0.0/12",
25 "vnet-subnet01-octet": 17
26 },
27 "resources": [
28 {
29 "comments": "",
30 "type": "Microsoft.Network/publicIPAddresses",
31 "name": "[concat(variables('ip-prefix'), variables('names')[0])]",
32 "apiVersion": "2017-03-01",
33 "location": "[resourceGroup().location]",
34 "properties": {
35 "publicIPAllocationMethod": "Dynamic",
36 "idleTimeoutInMinutes": 4,
37 "dnsSettings": {
38 "domainNameLabel": "[concat(variables('unique-prefix'), '-', variables('names')[0])]"
39 }
40 },
41 "resources": [],
42 "dependsOn": []
43 },
44 {
45 "comments": "",
46 "type": "Microsoft.Compute/virtualMachines",
47 "name": "[concat(variables('vm-prefix'), variables('names')[0])]",
48 "apiVersion": "2016-04-30-preview",
49 "location": "[resourceGroup().location]",
50 "properties": {
51 "hardwareProfile": {
52 "vmSize": "[variables('vm-size')]"
53 },
54 "storageProfile": {
55 "imageReference": {
56 "publisher": "OpenLogic",
57 "offer": "CentOS",
58 "sku": "7.2",
59 "version": "latest"
60 },
61 "osDisk": {
62 "name": "[concat(variables('vm-prefix'), variables('names')[0], '-boot')]",
63 "createOption": "FromImage",
64 "vhd": {
65 "uri": "[concat(reference(concat('Microsoft.Storage/storageAccounts/', variables('storage-name')), '2015-06-15').primaryEndpoints.blob, 'vhds/', variables('names')[0], '-boot.vhd')]"
66 },
67 "caching": "ReadWrite"
68 },
69 "dataDisks": [
70 {
71 "name": "[concat(variables('vm-prefix'), variables('names')[0], '-disk01')]",
72 "diskSizeGB": 127,
73 "lun": 0,
74 "vhd": {
75 "uri": "[concat(reference(concat('Microsoft.Storage/storageAccounts/', variables('storage-name')), '2015-06-15').primaryEndpoints.blob, 'vhds/', variables('names')[0], '-data01.vhd')]"
76 },
77 "createOption": "Empty"
78 }
79 ]
80 },
81 "osProfile": {
82 "computerName": "[concat(variables('vm-prefix'), variables('names')[0])]",
83 "adminUsername": "[parameters('admin-username')]",
84 "linuxConfiguration": {
85 "disablePasswordAuthentication": true,
86 "ssh": {
87 "publicKeys": [
88 {
89 "path": "[variables('ssh-keypath')]",
90 "keyData": "[parameters('ssh-public-key')]"
91 }
92 ]
93 }
94 }
95 },
96 "networkProfile": {
97 "networkInterfaces": [
98 {
99 "id": "[resourceId('Microsoft.Network/networkInterfaces', concat(variables('nic-prefix'), variables('names')[0]))]"
100 }
101 ]
102 }
103 },
104 "resources": [],
105 "dependsOn": [
106 "[resourceId('Microsoft.Storage/storageAccounts', variables('storage-name'))]",
107 "[resourceId('Microsoft.Network/networkInterfaces', concat(variables('nic-prefix'), variables('names')[0]))]"
108 ]
109 },
110 {
111 "type": "Microsoft.Compute/virtualMachines/extensions",
112 "name": "[concat(variables('vm-prefix'), variables('names')[0], '/script')]",
113 "apiVersion": "2015-05-01-preview",
114 "location": "[resourceGroup().location]",
115 "dependsOn": [
116 "[concat(variables('vm-prefix'), variables('names')[0])]"
117 ],
118 "properties": {
119 "publisher": "Microsoft.Azure.Extensions",
120 "type": "CustomScript",
121 "typeHandlerVersion": "2.0",
122 "autoUpgradeMinorVersion": true,
123 "settings": {
124 "fileUris": [
125 "https://linux.azure.david.betz.space/raw/elasticsearch-secure/install.sh"
126 ],
127 "commandToExecute": "sh install.sh"
128 }
129 }
130 },
131 {
132 "comments": "",
133 "type": "Microsoft.Network/networkInterfaces",
134 "name": "[concat(variables('nic-prefix'), variables('names')[0])]",
135 "apiVersion": "2017-03-01",
136 "location": "[resourceGroup().location]",
137 "properties": {
138 "ipConfigurations": [
139 {
140 "name": "ifconfig1",
141 "properties": {
142 "publicIPAddress": {
143 "id": "[resourceId('Microsoft.Network/publicIPAddresses', concat(variables('ip-prefix'), variables('names')[0]))]"
144 },
145 "subnet": {
146 "id": "[concat(resourceId('Microsoft.Network/virtualNetworks', variables('vnet-name')), '/subnets/subnet01')]"
147 }
148 }
149 }
150 ],
151 "dnsSettings": {
152 "dnsServers": []
153 },
154 "enableIPForwarding": false,
155 "networkSecurityGroup": {
156 "id": "[resourceId('Microsoft.Network/networkSecurityGroups', concat(variables('nsg-prefix'), variables('names')[0]))]"
157 }
158 },
159 "resources": [],
160 "dependsOn": [
161 "[resourceId('Microsoft.Network/publicIPAddresses', concat(variables('ip-prefix'), variables('names')[0]))]",
162 "[resourceId('Microsoft.Network/virtualNetworks', variables('vnet-name'))]",
163 "[resourceId('Microsoft.Network/networkSecurityGroups', concat(variables('nsg-prefix'), variables('names')[0]))]"
164 ]
165 },
166 {
167 "comments": "",
168 "type": "Microsoft.Network/virtualNetworks",
169 "name": "[variables('vnet-name')]",
170 "apiVersion": "2017-03-01",
171 "location": "[resourceGroup().location]",
172 "properties": {
173 "addressSpace": {
174 "addressPrefixes": [
175 "[variables('vnet-address-space')]"
176 ]
177 },
178 "subnets": [
179 {
180 "name": "subnet01",
181 "properties": {
182 "addressPrefix": "[concat('10.', variables('vnet-subnet01-octet'), '.0.0/16')]"
183 }
184 }
185 ]
186 },
187 "resources": [],
188 "dependsOn": []
189 },
190 {
191 "comments": "",
192 "type": "Microsoft.Network/networkSecurityGroups",
193 "name": "[concat(variables('nsg-prefix'), variables('names')[0])]",
194 "apiVersion": "2017-03-01",
195 "location": "[resourceGroup().location]",
196 "properties": {
197 "securityRules": [
198 {
199 "name": "default-allow-ssh",
200 "properties": {
201 "protocol": "Tcp",
202 "sourcePortRange": "*",
203 "destinationPortRange": "22",
204 "sourceAddressPrefix": "*",
205 "destinationAddressPrefix": "*",
206 "access": "Allow",
207 "priority": 1000,
208 "direction": "Inbound"
209 }
210 },
211 {
212 "name": "http",
213 "properties": {
214 "protocol": "Tcp",
215 "sourcePortRange": "*",
216 "destinationPortRange": "80",
217 "sourceAddressPrefix": "*",
218 "destinationAddressPrefix": "*",
219 "access": "Allow",
220 "priority": 1100,
221 "direction": "Inbound"
222 }
223 },
224 {
225 "name": "https",
226 "properties": {
227 "protocol": "Tcp",
228 "sourcePortRange": "*",
229 "destinationPortRange": "443",
230 "sourceAddressPrefix": "*",
231 "destinationAddressPrefix": "*",
232 "access": "Allow",
233 "priority": 1200,
234 "direction": "Inbound"
235 }
236 }
237 ]
238 },
239 "resources": [],
240 "dependsOn": []
241 },
242 {
243 "comments": "",
244 "type": "Microsoft.Storage/storageAccounts",
245 "sku": {
246 "name": "Standard_LRS",
247 "tier": "Standard"
248 },
249 "kind": "Storage",
250 "name": "[variables('storage-name')]",
251 "apiVersion": "2016-01-01",
252 "location": "[resourceGroup().location]",
253 "tags": {},
254 "properties": { },
255 "resources": [],
256 "dependsOn": []
257 }
258 ],
259 "outputs": {
260 "sshCommand": {
261 "type": "string",
262 "value": "[concat('ssh ', variables('unique-prefix'), '-', variables('names')[0], '.', resourceGroup().location, '.cloudapp.azure.com')]"
263 }
264 }
265 }
266
267
268
269