@@ -10,6 +10,10 @@ param Location string = deployment().location
10
10
//Private Cloud
11
11
@description ('Set this to false if the Private Cloud already exists' )
12
12
param DeployPrivateCloud bool = false
13
+ @description ('Optional: The location the private cloud should be deployed to, by default this will be the location of the deployment' )
14
+ param PrivateCloudName string = '${Prefix }-sddc'
15
+ @description ('Optional: The location the private cloud should be deployed to, by default this will be the location of the deployment' )
16
+ param PrivateCloudResourceGroupName string = '${Prefix }-PrivateCloud'
13
17
@description ('The address space used for the AVS Private Cloud management networks. Must be a non-overlapping /22' )
14
18
param PrivateCloudAddressSpace string = ''
15
19
@description ('The SKU that should be used for the first cluster, ensure you have quota for the given SKU before deploying' )
@@ -29,26 +33,22 @@ param ExistingPrivateCloudName string = ''
29
33
param ExistingPrivateCloudResourceId string = ''
30
34
31
35
//Azure Networking
32
- @description ('Set this to true if you are redeploying, and the VNet already exists' )
33
- param VNetExists bool = false
34
36
@description ('A string value to skip the networking deployment' )
35
37
param DeployNetworking bool = false
36
38
@description ('Set this to true if you are redeploying, and the VNet already exists' )
37
- param GatewayExists bool = false
38
- @description ('Does the GatewaySubnet Exist' )
39
- param GatewaySubnetExists bool = false
39
+ param VNetExists bool = false
40
+ @description ('The address space used for the VNet attached to AVS. Must be non-overlapping with existing networks' )
41
+ param NewNetworkResourceGroupName string = '${Prefix }-Network'
42
+ @description ('The address space used for the VNet attached to AVS. Must be non-overlapping with existing networks' )
43
+ param NewNetworkName string = '${Prefix }-vnet'
40
44
@description ('The address space used for the VNet attached to AVS. Must be non-overlapping with existing networks' )
41
45
param NewVNetAddressSpace string = ''
42
46
@description ('The subnet CIDR used for the Gateway Subnet. Must be a /24 or greater within the VNetAddressSpace' )
43
47
param NewVnetNewGatewaySubnetAddressPrefix string = ''
44
- @description ('The Existing VNet name' )
45
- param ExistingVnetName string = ''
48
+ @description ('The Existing Gateway name' )
49
+ param ExistingNetworkResourceId string = ''
46
50
@description ('The Existing Gateway name' )
47
51
param ExistingGatewayName string = ''
48
- @description ('The existing vnet gatewaysubnet id' )
49
- param ExistingGatewaySubnetId string = ''
50
- @description ('The existing vnet new gatewaysubnet prefix' )
51
- param ExistingVnetNewGatewaySubnetPrefix string = ''
52
52
53
53
//Jumpbox
54
54
@description ('Should a Jumpbox & Bastion be deployed to access the Private Cloud' )
@@ -61,35 +61,56 @@ param JumpboxPassword string = ''
61
61
@description ('The subnet CIDR used for the Jumpbox VM Subnet. Must be a /26 or greater within the VNetAddressSpace' )
62
62
param JumpboxSubnet string = ''
63
63
@description ('The sku to use for the Jumpbox VM, must have quota for this within the target region' )
64
- param JumpboxSku string = 'Standard_D2s_v3'
64
+ param JumpboxSku string = 'Standard_B2ms'
65
+ @description ('Set the OS version to use' )
66
+ @allowed ([
67
+ 'win2022'
68
+ 'win2019'
69
+ 'win11'
70
+ 'win11ms'
71
+ 'ubuntu2004gen2'
72
+ ])
73
+ param operatingSystemSKU string = 'win2019'
74
+
75
+
76
+ //Jumpbox Bootstrap OS
77
+ param BootstrapJumpboxVM bool = false
78
+ @description ('The path for Jumpbox VM bootstrap PowerShell script file (expecting "bootstrap.ps1" file)' )
79
+ param BootstrapPath string = 'https://raw.githubusercontent.com/shaunjacob/AVSLevelUpFY23/master/LevelUp/LZwtihAVS/Bicep/Bootstrap.ps1'
80
+ @description ('The command to trigger running the bootstrap script. If was not provided, then the expected script file name must be "bootstrap.ps1")' )
81
+ param BootstrapCommand string = 'powershell.exe -ExecutionPolicy Unrestricted -File bootstrap.ps1'
65
82
@description ('The subnet CIDR used for the Bastion Subnet. Must be a /26 or greater within the VNetAddressSpace' )
66
83
param BastionSubnet string = ''
67
84
68
- //On-premise Networking
69
- @description ('A boolean flag to deploy a Route Serrver or skip' )
70
- param DeployRouteServer bool = false
71
- @description ('A boolean flag to deploy a Route Serrver or skip' )
72
- param RouteServerVNetName string = ''
73
- @description ('Does a RouteServerSubnet exists?' )
74
- param RouteServerSubnetExists bool = false
75
- @description ('Flag to check onpremise connectivity method, ExpressRoute or VPN' )
76
- param OnPremConnectivity string = ''
77
- @description ('The subnet CIDR used for the RouteServer Subnet' )
78
- param RouteServerSubnetPrefix string = ''
79
-
80
- //Monitoring
81
- @description ('Deploy AVS Dashboard' )
85
+ // Monitoring Module Parameters
86
+ param MonitoringResourceGroupName string = '${Prefix }-Operational'
87
+ param DeployMonitoring bool = false
82
88
param DeployDashboard bool = false
83
- @description ('Deploy Azure Monitor metric alerts for your AVS Private Cloud' )
84
89
param DeployMetricAlerts bool = false
85
- @description ('Deploy Service Health Alerts for AVS' )
86
90
param DeployServiceHealth bool = false
87
- @
description (
'Email addresses to be added to the alerting action group. Use the format ["[email protected] ","[email protected] "].' )
88
91
param AlertEmails string = ''
92
+ param CPUUsageThreshold int = 60
93
+ param MemoryUsageThreshold int = 60
94
+ param StorageUsageThreshold int = 60
95
+
96
+ //Diagnostic Module Parameters
97
+ param LoggingResourceGroupName string = '${Prefix }-Operational'
98
+ param DeployDiagnostics bool = false
99
+ param EnableAVSLogsWorkspaceSetting bool = false
100
+ param DeployActivityLogDiagnostics bool = false
101
+ param EnableAVSLogsStorageSetting bool = false
102
+ param DeployWorkbook bool = false
103
+ param DeployWorkspace bool = false
104
+ param NewWorkspaceName string = '${Prefix }-log'
105
+ param NewStorageAccountName string = ''
106
+ param DeployStorageAccount bool = false
107
+ param ExistingWorkspaceId string = ''
108
+ param ExistingStorageAccountId string = ''
109
+ param StorageRetentionDays int = 1
89
110
90
111
//Addons
91
112
@description ('Should HCX be deployed as part of the deployment' )
92
- param DeployHCX bool = true
113
+ param DeployHCX bool = false
93
114
@description ('Should SRM be deployed as part of the deployment' )
94
115
param DeploySRM bool = false
95
116
@description ('License key to be used if SRM is deployed' )
@@ -102,15 +123,35 @@ param VRServerCount int = 1
102
123
@description ('Opt-out of deployment telemetry' )
103
124
param TelemetryOptOut bool = false
104
125
126
+ param utc string = utcNow ()
127
+
105
128
//Variables
106
129
var deploymentPrefix = 'AVS-${uniqueString (deployment ().name , Location )}'
107
130
var varCuaid = '1cf4a3e3-529c-4fb2-ba6a-63dff7d71586'
108
131
132
+ //Custom Naming
133
+ @description ('Optional. AVS resources custom naming. (Default: false)' )
134
+ param avsUseCustomNaming bool = true
135
+ var PrefixLowercase = toLower (Prefix )
136
+ var uniquestorageaccountname = '${PrefixLowercase }${uniqueString (utc )}'
137
+ var customPrivateCloudResourceGroupName = avsUseCustomNaming ? PrivateCloudResourceGroupName : '${Prefix }-PrivateCloud'
138
+ var customSDDCName = avsUseCustomNaming ? PrivateCloudName : '${Prefix }-sddc'
139
+ var customNetworkResourceGroupName = avsUseCustomNaming ? NewNetworkResourceGroupName : '${Prefix }-Network'
140
+ var customNetworkName = avsUseCustomNaming ? NewNetworkName : '${Prefix }-vnet'
141
+ var customMonitoringResourceGroupName = avsUseCustomNaming ? MonitoringResourceGroupName : '${Prefix }-Operational'
142
+ var customLoggingResourceGroupName = avsUseCustomNaming ? LoggingResourceGroupName : '${Prefix }-Operational'
143
+ var customWorkspaceName = avsUseCustomNaming ? NewWorkspaceName : '${Prefix }-log'
144
+ var customStorageAccountName = avsUseCustomNaming ? NewStorageAccountName : uniquestorageaccountname
145
+
146
+
147
+
109
148
module AVSCore 'Modules/AVSCore.bicep' = {
110
149
name : '${deploymentPrefix }-AVS'
111
150
params : {
112
151
Prefix : Prefix
113
152
Location : Location
153
+ PrivateCloudName : customSDDCName
154
+ PrivateCloudResourceGroupName : customPrivateCloudResourceGroupName
114
155
PrivateCloudAddressSpace : PrivateCloudAddressSpace
115
156
PrivateCloudHostCount : PrivateCloudHostCount
116
157
PrivateCloudSKU : PrivateCloudSKU
@@ -125,12 +166,10 @@ module AzureNetworking 'Modules/AzureNetworking.bicep' = if (DeployNetworking) {
125
166
Prefix : Prefix
126
167
Location : Location
127
168
VNetExists : VNetExists
128
- ExistingVnetName : ExistingVnetName
129
- GatewayExists : GatewayExists
169
+ NewNetworkName : customNetworkName
170
+ NewNetworkResourceGroupName : customNetworkResourceGroupName
171
+ ExistingNetworkResourceId : ExistingNetworkResourceId
130
172
ExistingGatewayName : ExistingGatewayName
131
- GatewaySubnetExists : GatewaySubnetExists
132
- ExistingGatewaySubnetId : ExistingGatewaySubnetId
133
- ExistingVnetNewGatewaySubnetPrefix : ExistingVnetNewGatewaySubnetPrefix
134
173
NewVNetAddressSpace : NewVNetAddressSpace
135
174
NewVnetNewGatewaySubnetAddressPrefix : NewVnetNewGatewaySubnetAddressPrefix
136
175
}
@@ -148,18 +187,6 @@ module VNetConnection 'Modules/VNetConnection.bicep' = if (DeployNetworking) {
148
187
}
149
188
}
150
189
151
- module RouteServer 'Modules/RouteServer.bicep' = if ((OnPremConnectivity == 'VPN' ) && (DeployRouteServer )) {
152
- name : '${deploymentPrefix }-RouteServer'
153
- params : {
154
- Prefix : Prefix
155
- Location : Location
156
- VNetName : DeployNetworking ? AzureNetworking .outputs .VNetName : RouteServerVNetName
157
- RouteServerSubnetPrefix : RouteServerSubnetPrefix
158
- RouteServerSubnetExists : RouteServerSubnetExists
159
- }
160
- }
161
-
162
-
163
190
module Jumpbox 'Modules/JumpBox.bicep' = if (DeployJumpbox ) {
164
191
name : '${deploymentPrefix }-Jumpbox'
165
192
params : {
@@ -172,21 +199,49 @@ module Jumpbox 'Modules/JumpBox.bicep' = if (DeployJumpbox) {
172
199
BastionSubnet : BastionSubnet
173
200
JumpboxSubnet : JumpboxSubnet
174
201
JumpboxSku : JumpboxSku
202
+ operatingSystemSKU : operatingSystemSKU
203
+ BootstrapJumpboxVM : BootstrapJumpboxVM
204
+ BootstrapPath : BootstrapPath
205
+ BootstrapCommand : BootstrapCommand
175
206
}
176
207
}
177
208
178
- module OperationalMonitoring 'Modules/Monitoring.bicep' = if ((DeployMetricAlerts ) || ( DeployServiceHealth ) || ( DeployDashboard )) {
209
+ module OperationalMonitoring 'Modules/Monitoring.bicep' = if ((DeployMonitoring )) {
179
210
name : '${deploymentPrefix }-Monitoring'
180
211
params : {
181
212
AlertEmails : AlertEmails
182
213
Prefix : Prefix
183
- PrimaryLocation : Location
214
+ Location : Location
215
+ MonitoringResourceGroupName : customMonitoringResourceGroupName
184
216
DeployMetricAlerts : DeployMetricAlerts
185
217
DeployServiceHealth : DeployServiceHealth
186
218
DeployDashboard : DeployDashboard
187
- PrimaryPrivateCloudName : DeployPrivateCloud ? AVSCore .outputs .PrivateCloudName : ExistingPrivateCloudName
188
- PrimaryPrivateCloudResourceId : DeployPrivateCloud ? AVSCore .outputs .PrivateCloudResourceId : ExistingPrivateCloudResourceId
189
- ExRConnectionResourceId : DeployNetworking ? VNetConnection .outputs .ExRConnectionResourceId : ''
219
+ DeployWorkbook : DeployWorkbook
220
+ PrivateCloudName : DeployPrivateCloud ? AVSCore .outputs .PrivateCloudName : ExistingPrivateCloudName
221
+ PrivateCloudResourceId : DeployPrivateCloud ? AVSCore .outputs .PrivateCloudResourceId : ExistingPrivateCloudResourceId
222
+ CPUUsageThreshold : CPUUsageThreshold
223
+ MemoryUsageThreshold : MemoryUsageThreshold
224
+ StorageUsageThreshold : StorageUsageThreshold
225
+ }
226
+ }
227
+
228
+ module Diagnostics 'Modules/Diagnostics.bicep' = if ((DeployDiagnostics )) {
229
+ name : '${deploymentPrefix }-Diagnostics'
230
+ params : {
231
+ Location : Location
232
+ LoggingResourceGroupName : customLoggingResourceGroupName
233
+ EnableAVSLogsWorkspaceSetting : EnableAVSLogsWorkspaceSetting
234
+ DeployActivityLogDiagnostics : DeployActivityLogDiagnostics
235
+ EnableAVSLogsStorageSetting : EnableAVSLogsStorageSetting
236
+ DeployWorkspace : DeployWorkspace
237
+ NewWorkspaceName : customWorkspaceName
238
+ DeployStorageAccount : DeployStorageAccount
239
+ NewStorageAccountName : customStorageAccountName
240
+ PrivateCloudName : DeployPrivateCloud ? AVSCore .outputs .PrivateCloudName : ExistingPrivateCloudName
241
+ PrivateCloudResourceId : DeployPrivateCloud ? AVSCore .outputs .PrivateCloudResourceId : ExistingPrivateCloudResourceId
242
+ ExistingWorkspaceId : ExistingWorkspaceId
243
+ ExistingStorageAccountId : ExistingStorageAccountId
244
+ StorageRetentionDays : StorageRetentionDays
190
245
}
191
246
}
192
247
0 commit comments