Created
June 7, 2019 13:05
-
-
Save chgeuer/e749bb76df3800110ca76b404990b4f0 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": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
| "contentVersion": "1.0.0.0", | |
| "variables": { | |
| "nsgName": "nsg", | |
| "numberOfASGs": 130, | |
| "apiVersions": { "network": "2018-01-01" } | |
| }, | |
| "resources": [ | |
| { | |
| "copy": { "name": "asg", "count": "[variables('numberOfASGs')]" }, | |
| "type": "Microsoft.Network/applicationSecurityGroups", | |
| "apiVersion": "[variables('apiVersions').network]", | |
| "name": "[asg.name(mul(1, copyIndex('asg', 0)))]", | |
| "location": "[resourceGroup().location]" | |
| }, | |
| { | |
| "type": "Microsoft.Network/networkSecurityGroups", | |
| "apiVersion": "[variables('apiVersions').network]", | |
| "name": "[variables('nsgName')]", | |
| "location": "[resourceGroup().location]" | |
| }, | |
| { | |
| "copy": { "name": "rule", "count": 50 }, | |
| "name": "[concat(variables('nsgName'), '/', format('rule--{0:D3}', copyIndex('rule')))]", | |
| "type": "Microsoft.Network/networkSecurityGroups/securityRules", | |
| "apiVersion": "[variables('apiVersions').network]", | |
| "dependsOn": [ "[concat('Microsoft.Network/networkSecurityGroups/', variables('nsgName'))]", "asg"], | |
| "properties": { | |
| "priority": "[copyIndex('rule', 100)]", | |
| "protocol": "*", "sourcePortRange": "*", "destinationPortRange": "*", | |
| "access": "Allow", "direction": "Inbound", | |
| "sourceApplicationSecurityGroups": [ { "id": "[resourceId('Microsoft.Network/applicationSecurityGroups', asg.name(add(0, mul(2, copyIndex('rule')))))]" } ], | |
| "destinationApplicationSecurityGroups": [ { "id": "[resourceId('Microsoft.Network/applicationSecurityGroups', asg.name(add(1, mul(2, copyIndex('rule')))))]" } ] | |
| } | |
| } | |
| ], | |
| "functions": [ | |
| { | |
| "namespace": "asg", | |
| "members": { | |
| "name": { | |
| "parameters": [ | |
| { "name": "i", "type": "int" } | |
| ], | |
| "output": { | |
| "value": "[concat('asg--', format('{0:D3}', parameters('i')))]", | |
| "type": "string" | |
| } | |
| } | |
| } | |
| } | |
| ] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment