Skip to content

Commit 88f4454

Browse files
cgns-gitlab-mirror-app[bot]chkp-avivmchkp-michaeltzchkp-liavbchkp-noamerez
authored
feat(CGNSPC-407): Azure | ARM | mds | Add support for avilability zones (#562)
Co-authored-by: Aviv Meydan <avivm@checkpoint.com> Co-authored-by: michaeltz <michaeltz@checkpoint.com> Co-authored-by: liavb <liavb@checkpoint.com> Co-authored-by: noamerez <noamerez@checkpoint.com>
1 parent 1a03654 commit 88f4454

2 files changed

Lines changed: 58 additions & 1 deletion

File tree

azure/templates/marketplace-mds/createUiDefinition.json

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,44 @@
11
{
22
"$schema": "https://schema.management.azure.com/schemas/0.1.2-preview/CreateUIDefinition.MultiVm.json#",
3-
"handler": "Microsoft.Compute.MultiVm",
3+
"handler": "Microsoft.Azure.CreateUIDef",
44
"version": "0.1.2-preview",
55
"parameters": {
66
"basics": [
7+
{
8+
"name": "zoneInfo",
9+
"type": "Microsoft.Solutions.ArmApiControl",
10+
"request": {
11+
"method": "GET",
12+
"path": "[concat('/subscriptions/', subscription().subscriptionId, '/locations/?api-version=2022-12-01')]"
13+
}
14+
},
15+
{
16+
"name": "availabilityZonesChoice",
17+
"type": "Microsoft.Common.OptionsGroup",
18+
"label": "Use availability zones",
19+
"defaultValue": "No",
20+
"toolTip": "Deploy the MDS VM in an availability zone for high availability and fault tolerance.",
21+
"constraints": {
22+
"allowedValues": [
23+
{ "label": "No", "value": "No" },
24+
{ "label": "Yes", "value": "Yes" }
25+
]
26+
},
27+
"visible": "[and(not(empty(basics('zoneInfo').value)), greater(int(if(greater(length(filter(basics('zoneInfo').value, (r) => equals(r.name, location()))), 0), if(greater(length(first(filter(basics('zoneInfo').value, (r) => equals(r.name, location()))).availabilityZoneMappings), 0), string(length(first(filter(basics('zoneInfo').value, (r) => equals(r.name, location()))).availabilityZoneMappings)), '0'), '0')), 0))]"
28+
},
29+
{
30+
"name": "zoneDropdown",
31+
"type": "Microsoft.Common.DropDown",
32+
"label": "Availability zone",
33+
"toolTip": "Select the availability zone for the MDS VM.",
34+
"filter": true,
35+
"defaultValue": "Zone 1",
36+
"constraints": {
37+
"allowedValues": "[map(range(1, int(string(length(first(filter(basics('zoneInfo').value, (r) => equals(r.name, location()))).availabilityZoneMappings)))), (item) => parse(concat('{\"label\":\"Zone ', string(item), '\",\"value\":\"', string(item), '\"}')))]",
38+
"required": false
39+
},
40+
"visible": "[and(equals(basics('availabilityZonesChoice'), 'Yes'), not(equals(steps('chkp-advanced').adminShell, '__dependency__')))]"
41+
},
742
{
843
"name": "CloudGuard MDS deployment guide",
944
"type": "Microsoft.Common.TextBlock",
@@ -802,6 +837,8 @@
802837
"additionalDiskSizeGB": "[int(steps('chkp-advanced').additionalDiskSizeGB)]",
803838
"diskType": "[if(contains('R81.10' , steps('chkp').cloudGuardVersion) , steps('chkp-advanced').VMDiskTypeOldVersions , steps('chkp-advanced').VMDiskType)]",
804839
"sourceImageVhdUri": "[coalesce(steps('chkp-advanced').sourceImageVhdUri, 'noCustomUri')]",
840+
"availabilityZones": "[if(equals(basics('availabilityZonesChoice'), 'Yes'), parse(concat('[\"', coalesce(basics('zoneDropdown'), '1'), '\"]')), parse('[]'))]",
841+
"availabilityZonesChoice": "[basics('availabilityZonesChoice')]",
805842
"adminShell": "[steps('chkp-advanced').adminShell]",
806843
"tagsByResource": "[steps('tags').tagsByResource]",
807844
"deployNewNSG": "[steps('network').NSG]",

azure/templates/marketplace-mds/mainTemplate.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,24 @@
217217
"description": "The URI of the blob containing the development image"
218218
}
219219
},
220+
"availabilityZones": {
221+
"type": "array",
222+
"defaultValue": [],
223+
"metadata": {
224+
"description": "List of availability zones. When 'availabilityZonesChoice' is set to 'Yes', the VM will be deployed in the specified zone."
225+
}
226+
},
227+
"availabilityZonesChoice": {
228+
"type": "string",
229+
"defaultValue": "No",
230+
"allowedValues": [
231+
"No",
232+
"Yes"
233+
],
234+
"metadata": {
235+
"description": "Enable Availability Zones for the MDS VM. 'Yes' to use Availability Zones, or 'No' to deploy without zones."
236+
}
237+
},
220238
"_artifactsLocation": {
221239
"type": "string",
222240
"metadata": {
@@ -1074,6 +1092,7 @@
10741092
"serialConsoleIps": "[if(contains(variables('serialConsoleGeographies'),variables('location')),variables('serialConsoleGeographies')[variables('location')],createArray())]",
10751093
"storageAccountIps": "[concat(variables('SerialConsoleIps'),parameters('storageAccountAdditionalIps'))]",
10761094
"isBlink": "[bool('false')]",
1095+
"useAZ": "[equals(parameters('availabilityZonesChoice'), 'Yes')]",
10771096
"primary": "[equals(parameters('installationType'), 'mds-primary')]",
10781097
"secondary": "[equals(parameters('installationType'), 'mds-secondary')]",
10791098
"logserver": "[equals(parameters('installationType'), 'mds-logserver')]",
@@ -1445,6 +1464,7 @@
14451464
],
14461465
"location": "[variables('location')]",
14471466
"name": "[parameters('vmName')]",
1467+
"zones": "[if(variables('useAZ'), if(greater(length(parameters('availabilityZones')), 0), parameters('availabilityZones'), json('[\"1\"]')), json('null'))]",
14481468
"plan": "[if(equals(parameters('sourceImageVhdUri'),'noCustomUri'), variables('plan'), json('null'))]",
14491469
"identity": "[variables('identity')]",
14501470
"properties": {

0 commit comments

Comments
 (0)