forked from erjosito/azure-networking-lab
-
Notifications
You must be signed in to change notification settings - Fork 1
/
nic_nsg_slb.json
114 lines (114 loc) · 4.12 KB
/
nic_nsg_slb.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
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"nicName": {
"defaultValue": "myNic",
"type": "string"
},
"nsgName": {
"defaultValue": "myNsg",
"type": "string"
},
"ipConfigName": {
"defaultValue": "myIpConfig",
"type": "string"
},
"vnetName": {
"defaultValue": "myVnet",
"type": "string"
},
"subnetName": {
"defaultValue": "serverSubnet",
"type": "string"
},
"slbName": {
"defaultValue": "mySLB",
"type": "string"
},
"backendConfigName": {
"defaultValue": "myBackendConfig",
"type": "string"
}
},
"variables": {
"apiVersion": "2016-03-30"
},
"resources": [
{
"comments": "NSGs not required, but here for extra security",
"type": "Microsoft.Network/networkSecurityGroups",
"name": "[parameters('nsgName')]",
"apiVersion": "[variables('apiVersion')]",
"location": "[resourceGroup().location]",
"properties": {
"securityRules": [
{
"name": "default-allow-ssh",
"properties": {
"protocol": "TCP",
"sourcePortRange": "*",
"destinationPortRange": "22",
"sourceAddressPrefix": "*",
"destinationAddressPrefix": "*",
"access": "Allow",
"priority": 1000,
"direction": "Inbound"
}
},
{
"name": "default-allow-web",
"properties": {
"protocol": "TCP",
"sourcePortRange": "*",
"destinationPortRange": "80",
"sourceAddressPrefix": "*",
"destinationAddressPrefix": "*",
"access": "Allow",
"priority": 1010,
"direction": "Inbound"
}
}
]
},
"resources": [],
"dependsOn": []
},
{
"comments": "NICs created with dynamic IP addresses",
"type": "Microsoft.Network/networkInterfaces",
"name": "[parameters('nicName')]",
"apiVersion": "[variables('apiVersion')]",
"location": "[resourceGroup().location]",
"properties": {
"ipConfigurations": [
{
"name": "[parameters('ipConfigName')]",
"properties": {
"privateIPAllocationMethod": "Dynamic",
"subnet": {
"id": "[concat(resourceId('Microsoft.Network/virtualNetworks', parameters('vnetName')), '/subnets/', parameters('subnetName'))]"
},
"loadBalancerBackendAddressPools": [
{
"id": "[concat(resourceId('Microsoft.Network/loadBalancers', parameters('slbName')), '/backendAddressPools/', parameters('backendConfigName'))]"
}
]
}
}
],
"dnsSettings": {
"dnsServers": []
},
"enableIPForwarding": false,
"networkSecurityGroup": {
"id": "[resourceId('Microsoft.Network/networkSecurityGroups', parameters('nsgName'))]"
}
},
"resources": [],
"dependsOn": [
"[parameters('nsgName')]"
]
}
]
}