-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlb.bicep
More file actions
72 lines (69 loc) · 1.55 KB
/
lb.bicep
File metadata and controls
72 lines (69 loc) · 1.55 KB
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
param name string
param location string = 'uksouth'
resource pip 'Microsoft.Network/publicIPAddresses@2021-03-01' = {
name: '${name}-pip'
location: location
sku: {
name: 'Standard'
}
properties: {
publicIPAllocationMethod: 'Static'
}
}
resource lb 'Microsoft.Network/loadBalancers@2021-03-01' = {
name: name
location: location
sku: {
name: 'Standard'
}
properties: {
frontendIPConfigurations: [
{
name: 'frontend'
properties: {
publicIPAddress: {
id: pip.id
}
}
}
]
backendAddressPools: [
{
name: 'backend'
}
]
loadBalancingRules: [
{
name: 'http'
properties: {
frontendIPConfiguration: {
id: resourceId('Microsoft.Network/loadBalancers/frontendIPConfigurations', name, 'frontend')
}
backendAddressPool: {
id: resourceId('Microsoft.Network/loadBalancers/backendAddressPools', name, 'backend')
}
frontendPort: 80
backendPort: 80
protocol: 'Tcp'
probe: {
id: resourceId('Microsoft.Network/loadBalancers/probes', name, 'http')
}
}
}
]
probes: [
{
name: 'http'
properties: {
protocol: 'Http'
port: 80
requestPath: '/'
intervalInSeconds: 5
numberOfProbes: 2
}
}
]
}
}
output backendPoolId string = lb.properties.backendAddressPools[0].id
output publicIp string = pip.properties.ipAddress