-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.bicep
92 lines (83 loc) · 1.99 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
@description('Specifies the Azure location where the key vault should be created.')
param location string = resourceGroup().location
@description('Specifies the name of the VNet.')
param vnetname string = '${location}-azfw-sample-vnet'
@description('Specifies the address prefix to use for the VNet.')
param vnetaddressprefix string = '10.0.0.0/24'
@description('Specifies the address prefix to use for the AzureFirewallSubnet')
param firewallsubnetprefix string = '10.0.0.0/26'
@allowed([
28
29
30
31
])
@description('Specifies the size of the Public IP Prefix')
param ipprefixlength int = 31
var firewallname = '${vnetname}-fw'
var publicipname = '${vnetname}-pip'
var ipprefixname = '${vnetname}-ipprefix'
resource vnet 'Microsoft.Network/virtualNetworks@2020-05-01' = {
name: vnetname
location: location
properties: {
addressSpace: {
addressPrefixes: [
vnetaddressprefix
]
}
subnets: [
{
name: 'AzureFirewallSubnet'
properties: {
addressPrefix: firewallsubnetprefix
}
}
]
}
}
resource ipprefix 'Microsoft.Network/publicIPPrefixes@2020-05-01' = {
name: ipprefixname
location: location
sku: {
name: 'Standard'
}
properties: {
prefixLength: ipprefixlength
publicIPAddressVersion: 'IPv4'
ipTags: []
}
}
resource publicip 'Microsoft.Network/publicIPAddresses@2020-05-01' = {
name: publicipname
location: location
sku: {
name: 'Standard'
}
properties: {
publicIPAllocationMethod: 'Static'
publicIPPrefix: {
id: ipprefix.id
}
}
}
resource firewall 'Microsoft.Network/azureFirewalls@2020-05-01' = {
name: firewallname
location: location
properties: {
threatIntelMode: 'Alert'
ipConfigurations: [
{
name: '${firewallname}-vnetIpconf'
properties: {
subnet: {
id: '${vnet.id}/subnets/AzureFirewallSubnet'
}
publicIPAddress: {
id: publicip.id
}
}
}
]
}
}