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