-
Notifications
You must be signed in to change notification settings - Fork 16k
/
bastion.bicep
60 lines (51 loc) · 1.56 KB
/
bastion.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
// Creates an Azure Bastion Subnet and host in the specified virtual network
@description('The Azure region where the Bastion should be deployed')
param location string = resourceGroup().location
@description('Virtual network name')
param vnetName string
@description('The address prefix to use for the Bastion subnet')
param addressPrefix string = '192.168.250.0/27'
@description('The name of the Bastion public IP address')
param publicIpName string = 'pip-bastion'
@description('The name of the Bastion host')
param bastionHostName string = 'bastion-jumpbox'
// The Bastion Subnet is required to be named 'AzureBastionSubnet'
var subnetName = 'AzureBastionSubnet'
resource bastionSubnet 'Microsoft.Network/virtualNetworks/subnets@2022-01-01' = {
name: '${vnetName}/${subnetName}'
properties: {
addressPrefix: addressPrefix
privateEndpointNetworkPolicies: 'Disabled'
privateLinkServiceNetworkPolicies: 'Disabled'
}
}
resource publicIpAddressForBastion 'Microsoft.Network/publicIPAddresses@2022-01-01' = {
name: publicIpName
location: location
sku: {
name: 'Standard'
}
properties: {
publicIPAllocationMethod: 'Static'
}
}
resource bastionHost 'Microsoft.Network/bastionHosts@2022-01-01' = {
name: bastionHostName
location: location
properties: {
ipConfigurations: [
{
name: 'IpConf'
properties: {
subnet: {
id: bastionSubnet.id
}
publicIPAddress: {
id: publicIpAddressForBastion.id
}
}
}
]
}
}
output bastionId string = bastionHost.id