Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adventure Works: adding support for Availability Zones for connectivity #451

Merged
merged 2 commits into from
Mar 9, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,14 @@
"metadata": {
"description": "Provide subnet for VPN/ER."
}
},
"vpnOrErZones": {
"type": "array",
"defaultValue": []
},
"firewallZones": {
"type": "array",
"defaultValue": []
}
},
"variables": {
Expand Down Expand Up @@ -133,7 +141,25 @@
"addressPrefix": "[parameters('subnetMaskForAzFw')]"
}
}
]
],
"sku": {
"0": {
"name": "Standard",
"tier": "Standard"
},
"1": {
"name": "ErGw1AZ",
"tier": "ErGw1AZ"
},
"2": {
"name": "ErGw2AZ",
"tier": "ErGw2AZ"
},
"3": {
"name": "ErGw3AZ",
"tier": "ErGw3AZ"
}
}
},
"resources": [
{
Expand Down Expand Up @@ -200,8 +226,11 @@
"type": "Microsoft.Network/publicIpAddresses",
"location": "[parameters('location')]",
"name": "[variables('azVpnGwIpName')]",
"sku": {
"name": "[if(not(empty(parameters('vpnOrErZones'))), 'Standard', 'Basic')]"
},
"properties": {
"publicIPAllocationMethod": "Dynamic"
"publicIPAllocationMethod": "[if(not(empty(parameters('vpnOrErZones'))), 'Static', 'Dynamic')]"
}
},
{
Expand All @@ -216,6 +245,7 @@
],
"properties": {
"gatewayType": "Vpn",
"vpnGatewayGeneration": "Generation2",
"vpnType": "[parameters('vpnGwType')]",
"ipConfigurations": [
{
Expand All @@ -232,8 +262,8 @@
}
],
"sku": {
"name": "VpnGw1",
"tier": "VpnGw1"
"name": "[if(not(empty(parameters('vpnOrErZones'))), 'VpnGw2AZ', 'VpnGw1')]",
"tier": "[if(not(empty(parameters('vpnOrErZones'))), 'VpnGw2AZ', 'VpnGw1')]"
}
}
},
Expand All @@ -243,8 +273,11 @@
"type": "Microsoft.Network/publicIpAddresses",
"location": "[parameters('location')]",
"name": "[variables('azErGwIpName')]",
"sku": {
"name": "[if(not(empty(parameters('vpnOrErZones'))), 'Standard', 'Basic')]"
},
"properties": {
"publicIPAllocationMethod": "Dynamic"
"publicIPAllocationMethod": "[if(not(empty(parameters('vpnOrErZones'))), 'Static', 'Dynamic')]"
}
},
{
Expand Down Expand Up @@ -274,10 +307,7 @@
}
}
],
"sku": {
"name": "Standard",
"tier": "Standard"
}
"sku": "[variables('sku')[string(length(parameters('vpnOrErZones')))]]"
}
},
{
Expand All @@ -287,10 +317,10 @@
"name": "[variables('azFwIpName')]",
"location": "[parameters('location')]",
"sku": {
"name": "Standard"
},
"name": "[if(not(empty(parameters('firewallZones'))), 'Standard', 'Basic')]"
},
"properties": {
"publicIPAllocationMethod": "Static"
"publicIPAllocationMethod": "[if(not(empty(parameters('firewallZones'))), 'Static', 'Dynamic')]"
}
},
{
Expand All @@ -299,15 +329,12 @@
"type": "Microsoft.Network/azureFirewalls",
"name": "[variables('azfwname')]",
"location": "[parameters('location')]",
"zones": "[if(not(empty(parameters('firewallZones'))), parameters('firewallZones'), json('null'))]",
"dependsOn": [
"[concat('Microsoft.Network/publicIpAddresses/', variables('azFwIpName'))]",
"[concat('Microsoft.Network/virtualNetworks/', variables('hubName'))]"
],
"properties": {
"sku": {
"Name": "AZFW_VNet",
"Tier": "Standard"
},
"ipConfigurations": [
{
"name": "[variables('azFwIpName')]",
Expand Down
15 changes: 15 additions & 0 deletions docs/reference/adventureworks/armTemplates/es-hubspoke.json
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,16 @@
"subnetMaskForGw": {
"type": "string",
"defaultValue": ""
},
"vpnOrErZones": {
"type": "array",
"defaultValue": []
},
"firewallZones": {
"type": "array",
"defaultValue": []
}

},
"variables": {
"azPolicyEnvMapping": {
Expand Down Expand Up @@ -925,6 +934,12 @@
},
"subnetMaskForGw": {
"value": "[parameters('subnetMaskForGw')]"
},
"vpnOrErZones": {
"value": "[parameters('vpnOrErZones')]"
},
"firewallZones": {
"value": "[parameters('firewallZones')]"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -622,13 +622,14 @@
"name": "esNwLocation",
"type": "Microsoft.Common.DropDown",
"label": "Region for the first virtual network hub",
"filter": true,
"toolTip": "Select the target region for you connectivity deployment (requires you to provide a subscriptionId for connectivity)",
"constraints": {
"allowedValues": "[map(steps('esConnectivityGoalState').esLocationsApi.value, (item) => parse(concat('{\"label\":\"', item.displayName, '\",\"value\":\"', item.name, '\"}')))]",
"required": true
},
"visible": "[equals(steps('esConnectivityGoalState').esHub, 'Yes')]"
},
},
{
"name": "esVpnGw",
"type": "Microsoft.Common.OptionsGroup",
Expand All @@ -649,6 +650,33 @@
]
}
},
{
"name": "esGwOrErAz",
"type": "Microsoft.Common.DropDown",
"label": "Select Availability Zones for the Virtual Network Gateway/ExpressRoute Gateway",
"defaultValue": "None",
"multiselect": true,
"selectAll": true,
"filter": true,
"visible": "[and(or(equals(steps('esConnectivityGoalState').esVpnGw, 'Yes'), equals(steps('esConnectivityGoalState').esErGw, 'Yes')), or(or(or(or(or(or(or(or(equals(steps('esConnectivityGoalState').esNwLocation, 'canadacentral'), equals(steps('esConnectivityGoalState').esNwLocation, 'centralus')), equals(steps('esConnectivityGoalState').esNwLocation, 'eastus'), equals(steps('esConnectivityGoalState').esNwLocation, 'eastus2')), equals(steps('esConnectivityGoalState').esNwLocation, 'southcentralus'), equals(steps('esConnectivityGoalState').esNwLocation, 'westus2')), equals(steps('esConnectivityGoalState').esNwLocation, 'francecentral'), equals(steps('esConnectivityGoalState').esNwLocation, 'germanywestcentral')), equals(steps('esConnectivityGoalState').esNwLocation, 'northeurope'), equals(steps('esConnectivityGoalState').esNwLocation, 'westeurope')), equals(steps('esConnectivityGoalState').esNwLocation, 'uksouth'), equals(steps('esConnectivityGoalState').esNwLocation, 'southafricanorth')), equals(steps('esConnectivityGoalState').esNwLocation, 'japaneast'), equals(steps('esConnectivityGoalState').esNwLocation, 'southeastasia')), equals(steps('esConnectivityGoalState').esNwLocation, 'southeastasia'), equals(steps('esConnectivityGoalState').esNwLocation, 'australiaeast')))]",
"toolTip": "If 'Yes' is selected when also adding a subscription for connectivity, ARM will deploy Virtual Gateway/Express Route Gateway to the selected region and availability zones.",
"constraints": {
"allowedValues": [
{
"label": "Zone 1",
"value": "1"
},
{
"label": "Zone 2",
"value": "2"
},
{
"label": "Zone 3",
"value": "3"
}
]
}
},
{
"name": "esVpnGwType",
"type": "Microsoft.Common.OptionsGroup",
Expand All @@ -672,7 +700,7 @@
{
"name": "esAddressVpnOrEr",
"type": "Microsoft.Common.TextBox",
"label": "Subnet for VPN/Express route",
"label": "Subnet for VPN/ExpressRoute Gateways",
"toolTip": "Provide address prefix in CIDR notation (e.g 10.100.1.0/24)",
"defaultValue": "10.100.1.0/24",
"visible": "[or(equals(steps('esConnectivityGoalState').esErGw, 'Yes'), equals(steps('esConnectivityGoalState').esVpnGw, 'Yes'))]",
Expand Down Expand Up @@ -721,6 +749,33 @@
]
}
},
{
"name": "esFwAz",
"type": "Microsoft.Common.DropDown",
"label": "Select Availability Zones for the Azure Firewall",
"defaultValue": "None",
"multiselect": true,
"selectAll": true,
"filter": true,
"visible": "[and(equals(steps('esConnectivityGoalState').esAzFw, 'Yes'), or(or(or(or(or(or(or(or(equals(steps('esConnectivityGoalState').esNwLocation, 'canadacentral'), equals(steps('esConnectivityGoalState').esNwLocation, 'centralus')), equals(steps('esConnectivityGoalState').esNwLocation, 'eastus'), equals(steps('esConnectivityGoalState').esNwLocation, 'eastus2')), equals(steps('esConnectivityGoalState').esNwLocation, 'southcentralus'), equals(steps('esConnectivityGoalState').esNwLocation, 'westus2')), equals(steps('esConnectivityGoalState').esNwLocation, 'francecentral'), equals(steps('esConnectivityGoalState').esNwLocation, 'germanywestcentral')), equals(steps('esConnectivityGoalState').esNwLocation, 'northeurope'), equals(steps('esConnectivityGoalState').esNwLocation, 'westeurope')), equals(steps('esConnectivityGoalState').esNwLocation, 'uksouth'), equals(steps('esConnectivityGoalState').esNwLocation, 'southafricanorth')), equals(steps('esConnectivityGoalState').esNwLocation, 'japaneast'), equals(steps('esConnectivityGoalState').esNwLocation, 'southeastasia')), equals(steps('esConnectivityGoalState').esNwLocation, 'southeastasia'), equals(steps('esConnectivityGoalState').esNwLocation, 'australiaeast')))]",
"toolTip": "If 'Yes' is selected when also adding a subscription for connectivity, ARM will deploy Azure Firewall to the selected region and availability zones.",
"constraints": {
"allowedValues": [
{
"label": "Zone 1",
"value": "1"
},
{
"label": "Zone 2",
"value": "2"
},
{
"label": "Zone 3",
"value": "3"
}
]
}
},
{
"name": "esAddressFw",
"type": "Microsoft.Common.TextBox",
Expand Down Expand Up @@ -1416,6 +1471,8 @@
"enableVmMonitoring": "[steps('lzGoalState').esVmMonitoring]",
"enableVmssMonitoring": "[steps('lzGoalState').esVmssMonitoring]",
"enableArcMonitoring": "[steps('lzGoalState').esArcVmMonitoring]",
"vpnOrErZones": "[steps('esConnectivityGoalState').esGwOrErAz]",
"firewallZones": "[steps('esConnectivityGoalState').esGwOrErAz]",
"corpConnectedLzSubscriptionId": "[if(or(not(contains(steps('lzGoalState').esCorpLzSub, steps('esGoalState').esMgmtSub)), not(contains(steps('lzGoalState').esCorpLzSub, steps('esConnectivityGoalState').esConnectivitySub))), steps('lzGoalState').lzConnectedSubs, '')]"
}
}
Expand Down