Created
January 17, 2017 21:07
-
-
Save bobalob/a958a7d00747d7a80e991e4de8552449 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"masterPrefix": { | |
"type": "string", | |
"metadata": { | |
"description": "The prefix for all common resources in the deployment" | |
} | |
}, | |
"adminUsername": { | |
"type": "string", | |
"metadata": { | |
"description": "Admin username" | |
} | |
}, | |
"adminPassword": { | |
"type": "securestring", | |
"metadata": { | |
"description": "Admin password" | |
} | |
}, | |
"availabilityGroupsWithLoadBalancer": { | |
"type": "array", | |
"defaultValue": [ | |
"ninja", | |
"super" | |
] | |
}, | |
"availabilityGroups": { | |
"type": "array", | |
"defaultValue": [ | |
"mega", | |
"hyper" | |
] | |
}, | |
"singleVMs": { | |
"type": "array", | |
"defaultValue": [ | |
"sweet", | |
"awesome" | |
] | |
} | |
}, | |
"variables": { | |
"vNetName": "[concat(parameters('masterPrefix'), '-net')]", | |
"subnetName": "[concat(parameters('masterPrefix'), '-subnet1')]" | |
}, | |
"resources": [ | |
{ | |
"apiVersion": "2015-01-01", | |
"name": "networkTemplate", | |
"type": "Microsoft.Resources/deployments", | |
"properties": { | |
"mode": "Incremental", | |
"templateLink": { | |
"uri": "https://raw.githubusercontent.com/bobalob/ARM-Example/master/Network.JSON", | |
"contentVersion": "1.0.0.0" | |
}, | |
"parameters": { | |
"vNetName": { | |
"value": "[variables('vNetName')]" | |
}, | |
"subnetName": { | |
"value": "[variables('subnetName')]" | |
} | |
} | |
} | |
}, | |
{ | |
"name": "[concat('avlb', parameters('availabilityGroupsWithLoadBalancer')[copyIndex()])]", | |
"copy": { | |
"name": "avlbCopy", | |
"count": "[length(parameters('availabilityGroupsWithLoadBalancer'))]" | |
}, | |
"type": "Microsoft.Resources/deployments", | |
"apiVersion": "2015-01-01", | |
"dependsOn": [ | |
"Microsoft.Resources/deployments/networkTemplate" | |
], | |
"properties": { | |
"mode": "Incremental", | |
"templateLink": { | |
"uri": "https://raw.githubusercontent.com/bobalob/ARM-Example/master/AvailabilityGroupWithLB.json", | |
"contentVersion": "1.0.0.0" | |
}, | |
"parameters": { | |
"resourcesPrefix": { | |
"value": "[ parameters( 'availabilityGroupsWithLoadBalancer')[copyIndex()] ]" | |
}, | |
"adminUsername": { | |
"value": "[parameters('adminUsername')]" | |
}, | |
"adminPassword": { | |
"value": "[parameters('adminPassword')]" | |
}, | |
"vNetName": { | |
"value": "[variables('vNetName')]" | |
}, | |
"subnetName": { | |
"value": "[variables('subnetName')]" | |
} | |
} | |
} | |
}, | |
{ | |
"name": "[concat('av', parameters('availabilityGroups')[copyIndex()])]", | |
"copy": { | |
"name": "avlbCopy", | |
"count": "[length(parameters('availabilityGroups'))]" | |
}, | |
"type": "Microsoft.Resources/deployments", | |
"apiVersion": "2015-01-01", | |
"dependsOn": [ | |
"Microsoft.Resources/deployments/networkTemplate" | |
], | |
"properties": { | |
"mode": "Incremental", | |
"templateLink": { | |
"uri": "https://raw.githubusercontent.com/bobalob/ARM-Example/master/AvailabilityGroup.json", | |
"contentVersion": "1.0.0.0" | |
}, | |
"parameters": { | |
"resourcesPrefix": { | |
"value": "[ parameters( 'availabilityGroups')[copyIndex()] ]" | |
}, | |
"adminUsername": { | |
"value": "[parameters('adminUsername')]" | |
}, | |
"adminPassword": { | |
"value": "[parameters('adminPassword')]" | |
}, | |
"vNetName": { | |
"value": "[variables('vNetName')]" | |
}, | |
"subnetName": { | |
"value": "[variables('subnetName')]" | |
} | |
} | |
} | |
}, | |
{ | |
"name": "[concat('vm', parameters('singleVMs')[copyIndex()])]", | |
"copy": { | |
"name": "vmcopy", | |
"count": "[length(parameters('singleVMs'))]" | |
}, | |
"type": "Microsoft.Resources/deployments", | |
"apiVersion": "2015-01-01", | |
"dependsOn": [ | |
"Microsoft.Resources/deployments/networkTemplate" | |
], | |
"properties": { | |
"mode": "Incremental", | |
"templateLink": { | |
"uri": "https://raw.githubusercontent.com/bobalob/ARM-Example/master/SingleVM.json", | |
"contentVersion": "1.0.0.0" | |
}, | |
"parameters": { | |
"resourcesPrefix": { | |
"value": "[ parameters( 'singleVMs')[copyIndex()] ]" | |
}, | |
"adminUsername": { | |
"value": "[parameters('adminUsername')]" | |
}, | |
"adminPassword": { | |
"value": "[parameters('adminPassword')]" | |
}, | |
"vNetName": { | |
"value": "[variables('vNetName')]" | |
}, | |
"subnetName": { | |
"value": "[variables('subnetName')]" | |
} | |
} | |
} | |
} | |
], | |
"outputs": {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment