Skip to content

Commit d023557

Browse files
Added admin and removed jumpbox
1 parent 489ff8d commit d023557

File tree

2 files changed

+27
-24
lines changed

2 files changed

+27
-24
lines changed

infra/main.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ module virtualMachine 'br/public:avm/res/compute/virtual-machine:0.17.0' = if (e
586586
ipConfigurations: [
587587
{
588588
name: '${virtualMachineResourceName}-nic01-ipconfig01'
589-
subnetResourceId: virtualNetwork!.outputs.jumpboxSubnetResourceId
589+
subnetResourceId: virtualNetwork!.outputs.administrationSubnetResourceId
590590
diagnosticSettings: enableMonitoring //WAF aligned configuration for Monitoring
591591
? [{ workspaceResourceId: logAnalyticsWorkspaceResourceId }]
592592
: null

infra/modules/virtualNetwork.bicep

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,31 @@ param subnets subnetType[] = [
9595
]
9696
}
9797
}
98+
{
99+
name: 'administration'
100+
addressPrefixes: ['10.0.0.32/27']
101+
networkSecurityGroup: {
102+
name: 'nsg-administration'
103+
securityRules: [
104+
{
105+
name: 'deny-hop-outbound'
106+
properties: {
107+
access: 'Deny'
108+
destinationAddressPrefix: '*'
109+
destinationPortRanges: [
110+
'22'
111+
'3389'
112+
]
113+
direction: 'Outbound'
114+
priority: 200
115+
protocol: 'Tcp'
116+
sourceAddressPrefix: 'VirtualNetwork'
117+
sourcePortRange: '*'
118+
}
119+
}
120+
]
121+
}
122+
}
98123
{
99124
name: 'AzureBastionSubnet' // Required name for Azure Bastion
100125
addressPrefixes: ['10.0.0.64/26']
@@ -156,28 +181,6 @@ param subnets subnetType[] = [
156181
]
157182
}
158183
}
159-
{
160-
name: 'jumpbox'
161-
addressPrefixes: ['10.0.12.0/23'] // /23 (10.0.12.0 - 10.0.13.255), 512 addresses
162-
networkSecurityGroup: {
163-
name: 'nsg-jumpbox'
164-
securityRules: [
165-
{
166-
name: 'AllowRdpFromBastion'
167-
properties: {
168-
access: 'Allow'
169-
direction: 'Inbound'
170-
priority: 100
171-
protocol: 'Tcp'
172-
sourcePortRange: '*'
173-
destinationPortRange: '3389'
174-
sourceAddressPrefixes: ['10.0.10.0/26'] // Azure Bastion subnet
175-
destinationAddressPrefixes: ['10.0.12.0/23']
176-
}
177-
}
178-
]
179-
}
180-
}
181184
]
182185

183186
@description('Optional. Tags to be applied to the resources.')
@@ -306,9 +309,9 @@ output subnets subnetOutputType[] = [
306309
// Dynamic outputs for individual subnets for backward compatibility
307310
output backendSubnetResourceId string = contains(map(subnets, subnet => subnet.name), 'backend') ? virtualNetwork.outputs.subnetResourceIds[indexOf(map(subnets, subnet => subnet.name), 'backend')] : ''
308311
output containerSubnetResourceId string = contains(map(subnets, subnet => subnet.name), 'containers') ? virtualNetwork.outputs.subnetResourceIds[indexOf(map(subnets, subnet => subnet.name), 'containers')] : ''
312+
output administrationSubnetResourceId string = contains(map(subnets, subnet => subnet.name), 'administration') ? virtualNetwork.outputs.subnetResourceIds[indexOf(map(subnets, subnet => subnet.name), 'administration')] : ''
309313
output webserverfarmSubnetResourceId string = contains(map(subnets, subnet => subnet.name), 'webserverfarm') ? virtualNetwork.outputs.subnetResourceIds[indexOf(map(subnets, subnet => subnet.name), 'webserverfarm')] : ''
310314
output bastionSubnetResourceId string = contains(map(subnets, subnet => subnet.name), 'AzureBastionSubnet') ? virtualNetwork.outputs.subnetResourceIds[indexOf(map(subnets, subnet => subnet.name), 'AzureBastionSubnet')] : ''
311-
output jumpboxSubnetResourceId string = contains(map(subnets, subnet => subnet.name), 'jumpbox') ? virtualNetwork.outputs.subnetResourceIds[indexOf(map(subnets, subnet => subnet.name), 'jumpbox')] : ''
312315

313316
@export()
314317
@description('Custom type definition for subnet resource information as output')

0 commit comments

Comments
 (0)