-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.bicep
120 lines (115 loc) · 2.57 KB
/
main.bicep
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
115
116
117
118
119
120
param virtualNetworkName string = 'test-vnet'
param vnetAddressPrefix string = '10.0.0.0/16'
param azureFirewallSubnetAddressPrefix string = '10.0.1.0/24'
param firewallName string = 'firewall1'
param location string = resourceGroup().location
param availabilityZones array = [
'1'
'2'
'3'
]
var azureFirewallSubnetName = 'AzureFirewallSubnet'
resource virtualNetwork 'Microsoft.Network/virtualNetworks@2020-06-01' = {
name: virtualNetworkName
location: location
properties: {
addressSpace: {
addressPrefixes: [
vnetAddressPrefix
]
}
}
}
resource subnet 'Microsoft.Network/virtualNetworks/subnets@2020-06-01' = {
name: '${virtualNetwork.name}/${azureFirewallSubnetName}'
properties: {
addressPrefix: azureFirewallSubnetAddressPrefix
}
}
resource publicIP 'Microsoft.Network/publicIPAddresses@2020-06-01' = {
name: 'publicIp1'
location: location
sku: {
name: 'Standard'
}
properties: {
publicIPAllocationMethod: 'Static'
publicIPAddressVersion: 'IPv4'
}
}
resource firewall 'Microsoft.Network/azureFirewalls@2020-06-01' = {
name: firewallName
location: location
zones: length(availabilityZones) == 0 ? null : availabilityZones
properties: {
ipConfigurations: [
{
name: 'IpConf1'
properties: {
subnet: {
id: subnet.id
}
publicIPAddress: {
id: publicIP.id
}
}
}
]
applicationRuleCollections: [
{
name: 'appRc1'
properties: {
priority: 101
action: {
type: 'Allow'
}
rules: [
{
name: 'appRule1'
protocols: [
{
port: 80
protocolType: 'Http'
}
]
targetFqdns: [
'www.microsoft.com'
]
sourceAddresses: [
'10.0.0.0/24'
]
}
]
}
}
]
networkRuleCollections: [
{
name: 'netRc1'
properties: {
priority: 200
action: {
type: 'Allow'
}
rules: [
{
name: 'netRule1'
protocols: [
'TCP'
]
sourceAddresses: [
'10.0.0.0/24'
]
destinationAddresses: [
'*'
]
destinationPorts: [
'8000-8999'
]
}
]
}
}
]
}
}