-
Notifications
You must be signed in to change notification settings - Fork 1
/
nic.bicep
42 lines (38 loc) · 1002 Bytes
/
nic.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
param nicName string
param location string = resourceGroup().location
param subnetId string
param pipId string = ''
@allowed([
'Dynamic'
'Static'
])
param ipAllocationMethod string = 'Dynamic'
param staticIpAddress string = ''
param enableIPForwarding bool = false
resource nic 'Microsoft.Network/networkInterfaces@2020-06-01' = {
name: nicName
location: location
properties: {
ipConfigurations: [
{
name: 'ipconfig'
properties: {
primary: true
privateIPAllocationMethod: ipAllocationMethod
// pip is optional
privateIPAddress: staticIpAddress
subnet: {
id: subnetId
}
// pip looks to be optional
publicIPAddress: any((pipId == '') ? null : {
id: pipId
})
}
}
]
enableIPForwarding: enableIPForwarding
}
}
output nicId string = nic.id
output assignedIp string = nic.properties.ipConfigurations[0].properties.privateIPAddress