Skip to content

Commit b7f737e

Browse files
cgns-gitlab-mirror-app[bot]chkp-avivmchkp-michaeltzchkp-liavbchkp-nimrodgab
authored
feat(CGNSPC-440): Azure Extended Zones | ARM (main template and UI) (#572)
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: nimrodgab <nimrodgab@checkpoint.com> Co-authored-by: noamerez <noamerez@checkpoint.com>
1 parent 78c9c01 commit b7f737e

9 files changed

Lines changed: 244 additions & 52 deletions

File tree

azure/templates/marketplace-ha/createUiDefinition.json

Lines changed: 57 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,45 @@
44
"version": "0.1.2-preview",
55
"parameters": {
66
"basics": [
7+
{
8+
"name": "extendedZone",
9+
"type": "Microsoft.Common.DropDown",
10+
"label": "Extended Zone",
11+
"defaultValue": "None",
12+
"toolTip": "Deploy in Azure Extended Zone for ultra-low latency edge computing. Los Angeles Extended Zone requires West US region. Perth Extended Zone requires Australia East region. Extended Zone requires Premium_LRS and is supported for R81.20 and above. Extended Zone cannot be combined with Public IP Prefix.",
13+
"visible": "[not(equals(basics('availabilityZonesChoice'), 'Yes'))]",
14+
"constraints": {
15+
"allowedValues": [
16+
{
17+
"label": "None",
18+
"value": "None"
19+
},
20+
{
21+
"label": "Los Angeles (requires West US region)",
22+
"value": "losangeles"
23+
},
24+
{
25+
"label": "Perth (requires Australia East region)",
26+
"value": "perth"
27+
}
28+
],
29+
"required": true
30+
},
31+
"validations": [
32+
{
33+
"isValid": "[or(equals(basics('extendedZone'), 'None'), and(equals(basics('extendedZone'), 'losangeles'), equals(location(), 'westus')), and(equals(basics('extendedZone'), 'perth'), equals(location(), 'australiaeast')))]",
34+
"message": "Extended Zone selection is not compatible with the selected region. Los Angeles Extended Zone requires West US region, Perth Extended Zone requires Australia East region."
35+
},
36+
{
37+
"isValid": "[or(equals(basics('extendedZone'), 'None'), not(equals(steps('chkp-advanced').publicIPPrefix, 'yes')))]",
38+
"message": "Extended Zone cannot be combined with Public IP Prefix."
39+
},
40+
{
41+
"isValid": "[or(equals(basics('extendedZone'), 'None'), and(not(contains(createArray('R81.10'), steps('chkp').cloudGuardVersion)), equals(steps('chkp-advanced').VMDiskType, 'Premium_LRS')))]",
42+
"message": "Extended Zone requires version R81.20 or above and VM disk type Premium_LRS (Premium SSD)."
43+
}
44+
]
45+
},
746
{
847
"name": "zoneInfo",
948
"type": "Microsoft.Solutions.ArmApiControl",
@@ -24,7 +63,7 @@
2463
{ "label": "Yes", "value": "Yes" }
2564
]
2665
},
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))]"
66+
"visible": "[and(equals(basics('extendedZone'), 'None'), 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)))]"
2867
},
2968
{
3069
"name": "zonesDropdown",
@@ -39,12 +78,12 @@
3978
"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), '\"}')))]",
4079
"required": false
4180
},
42-
"visible": "[equals(basics('availabilityZonesChoice'), 'Yes')]"
81+
"visible": "[and(equals(basics('extendedZone'), 'None'), equals(basics('availabilityZonesChoice'), 'Yes'))]"
4382
},
4483
{
4584
"name": "zonesTooMany",
4685
"type": "Microsoft.Common.InfoBox",
47-
"visible": "[and(equals(basics('availabilityZonesChoice'), 'Yes'), greater(length(coalesce(basics('zonesDropdown'), parse('[]'))), 2))]",
86+
"visible": "[and(equals(basics('extendedZone'), 'None'), and(equals(basics('availabilityZonesChoice'), 'Yes'), greater(length(coalesce(basics('zonesDropdown'), parse('[]'))), 2)))]",
4887
"options": {
4988
"icon": "Error",
5089
"text": "HA cluster deploys exactly 2 VMs. Please select at most 2 availability zones."
@@ -1384,7 +1423,7 @@
13841423
}
13851424
]
13861425
},
1387-
"visible": true
1426+
"visible": "[equals(basics('extendedZone'), 'None')]"
13881427
},
13891428
{
13901429
"name": "createNewIPPrefix",
@@ -1404,7 +1443,7 @@
14041443
}
14051444
]
14061445
},
1407-
"visible": "[equals(steps('chkp-advanced').publicIPPrefix, 'yes')]"
1446+
"visible": "[and(equals(basics('extendedZone'), 'None'), equals(steps('chkp-advanced').publicIPPrefix, 'yes'))]"
14081447
},
14091448
{
14101449
"name": "ipPrefixExistingResourceId",
@@ -1417,7 +1456,7 @@
14171456
"regex": "^[a-z0-9A-Z -.:/n]{1,}$",
14181457
"validationMessage": "Only alphanumeric characters, hyphens, spaces, periods, and colons are allowed."
14191458
},
1420-
"visible": "[equals(steps('chkp-advanced').createNewIPPrefix, 'no')]"
1459+
"visible": "[and(equals(basics('extendedZone'), 'None'), and(equals(steps('chkp-advanced').publicIPPrefix, 'yes'), equals(steps('chkp-advanced').createNewIPPrefix, 'no')))]"
14211460
}
14221461
]
14231462
},
@@ -1753,7 +1792,7 @@
17531792
],
17541793
"required": true
17551794
},
1756-
"visible": true
1795+
"visible": "[equals(basics('extendedZone'), 'None')]"
17571796
},
17581797
{
17591798
"name": "addStorageAccountIpRules",
@@ -1774,7 +1813,7 @@
17741813
],
17751814
"required": "[equals(steps('network').storageAccountDeployMode, 'New')]"
17761815
},
1777-
"visible": "[equals(steps('network').storageAccountDeployMode, 'New')]"
1816+
"visible": "[and(equals(basics('extendedZone'), 'None'), equals(steps('network').storageAccountDeployMode, 'New'))]"
17781817
},
17791818
{
17801819
"name": "existingStorageAccount",
@@ -1786,12 +1825,12 @@
17861825
"constraints": {
17871826
"required": "[equals(steps('network').storageAccountDeployMode, 'Existing')]"
17881827
},
1789-
"visible": "[equals(steps('network').storageAccountDeployMode, 'Existing')]"
1828+
"visible": "[and(equals(basics('extendedZone'), 'None'), equals(steps('network').storageAccountDeployMode, 'Existing'))]"
17901829
},
17911830
{
17921831
"name": "infoExistingStorageAccount",
17931832
"type": "Microsoft.Common.InfoBox",
1794-
"visible": "[equals(steps('network').storageAccountDeployMode, 'Existing')]",
1833+
"visible": "[and(equals(basics('extendedZone'), 'None'), equals(steps('network').storageAccountDeployMode, 'Existing'))]",
17951834
"options": {
17961835
"icon": "Info",
17971836
"text": "The Storage Account must allow network access from the Serial Console feature, for more information - <a href='https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/linux/serial-console-linux?WT.mc_id=Portal-Microsoft_Azure_CreateUIDef' target='_blank'>Serial Console Security</a>."
@@ -1800,7 +1839,7 @@
18001839
{
18011840
"name": "infoManagedStorageAccount",
18021841
"type": "Microsoft.Common.InfoBox",
1803-
"visible": "[equals(steps('network').storageAccountDeployMode, 'Managed')]",
1842+
"visible": "[and(equals(basics('extendedZone'), 'None'), equals(steps('network').storageAccountDeployMode, 'Managed'))]",
18041843
"options": {
18051844
"icon": "Info",
18061845
"text": "Azure will use a managed Storage Account for the deployment, no additional configuration is required."
@@ -1809,7 +1848,7 @@
18091848
{
18101849
"name": "warningNoneStorageAccount",
18111850
"type": "Microsoft.Common.InfoBox",
1812-
"visible": "[equals(steps('network').storageAccountDeployMode, 'None')]",
1851+
"visible": "[and(equals(basics('extendedZone'), 'None'), equals(steps('network').storageAccountDeployMode, 'None'))]",
18131852
"options": {
18141853
"icon": "Warning",
18151854
"text": "Please note that deploying without a Storage Account will not allow you to use the Serial Console feature. For more information - <a href='https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/linux/serial-console-linux?WT.mc_id=Portal-Microsoft_Azure_CreateUIDef' target='_blank'>Azure Serial Console</a>."
@@ -1851,6 +1890,7 @@
18511890
],
18521891
"outputs": {
18531892
"location": "[location()]",
1893+
"extendedZone": "[basics('extendedZone')]",
18541894
"cloudGuardVersion": "[concat(steps('chkp').cloudGuardVersion, ' - ', coalesce(steps('chkp').R80Offer, 'Bring Your Own License'))]",
18551895
"adminPassword": "[basics('auth').password]",
18561896
"authenticationType": "[basics('auth').authenticationType]",
@@ -1874,13 +1914,13 @@
18741914
"diskType": "[if(contains('R81.10' , steps('chkp').cloudGuardVersion) , steps('chkp-advanced').VMDiskTypeOldVersions , steps('chkp-advanced').VMDiskType)]",
18751915
"managedSystemAssigned": "[steps('chkp-advanced').managedSystemAssigned]",
18761916
"sourceImageVhdUri": "[coalesce(steps('chkp-advanced').sourceImageVhdUri, 'noCustomUri')]",
1877-
"availabilityZones": "[if(equals(basics('availabilityZonesChoice'), 'Yes'), if(greater(length(coalesce(basics('zonesDropdown'), parse('[]'))), 0), basics('zonesDropdown'), parse('[\"1\", \"2\"]')), parse('[]'))]",
1878-
"availabilityZonesChoice": "[basics('availabilityZonesChoice')]",
1917+
"availabilityZones": "[if(and(equals(basics('extendedZone'), 'None'), equals(basics('availabilityZonesChoice'), 'Yes')), if(greater(length(coalesce(basics('zonesDropdown'), parse('[]'))), 0), basics('zonesDropdown'), parse('[\"1\", \"2\"]')), parse('[]'))]",
1918+
"availabilityZonesChoice": "[if(equals(basics('extendedZone'), 'None'), basics('availabilityZonesChoice'), 'No')]",
18791919
"customMetrics": "[steps('chkp-advanced').customMetrics]",
18801920
"floatingIP": "[steps('chkp-advanced').floatingIP]",
1881-
"publicIPPrefix": "[steps('chkp-advanced').publicIPPrefix]",
1882-
"createNewIPPrefix": "[steps('chkp-advanced').createNewIPPrefix]",
1883-
"ipPrefixExistingResourceId": "[steps('chkp-advanced').ipPrefixExistingResourceId]",
1921+
"publicIPPrefix": "[if(equals(basics('extendedZone'), 'None'), steps('chkp-advanced').publicIPPrefix, 'no')]",
1922+
"createNewIPPrefix": "[if(and(equals(basics('extendedZone'), 'None'), equals(steps('chkp-advanced').publicIPPrefix, 'yes')), steps('chkp-advanced').createNewIPPrefix, 'no')]",
1923+
"ipPrefixExistingResourceId": "[if(and(equals(basics('extendedZone'), 'None'), equals(steps('chkp-advanced').publicIPPrefix, 'yes'), equals(steps('chkp-advanced').createNewIPPrefix, 'no')), steps('chkp-advanced').ipPrefixExistingResourceId, '')]",
18841924
"adminShell": "[steps('chkp-advanced').adminShell]",
18851925
"smart1CloudTokenA": "[steps('chkp').Smart1CloudTokenA]",
18861926
"smart1CloudTokenB": "[steps('chkp').Smart1CloudTokenB]",

0 commit comments

Comments
 (0)