Skip to content

Commit

Permalink
Add supernet address prefix parameter input to Portal UI (#623)
Browse files Browse the repository at this point in the history
  • Loading branch information
glennmusa authored Jan 28, 2022
1 parent 568c676 commit 4181681
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/bicep/form/mlz.portal.json
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,22 @@
"label": "Hub Virtual Network",
"type": "Microsoft.Common.Section",
"elements": [
{
"name": "superNetworkAddressCidrRange",
"label": "Super Network CIDR Range",
"type": "Microsoft.Common.TextBox",
"defaultValue": "10.0.96.0/19",
"toolTip": "Specify an address CIDR range within the range [10,24].",
"constraints": {
"required": true,
"validations": [
{
"regex": "^(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\/(1[0-9]|2[0-3]))$",
"message": "Invalid CIDR range. The address prefix must be in the range [10,24]."
}
]
}
},
{
"name": "virtualNetworkAddressCidrRange",
"label": "Hub Virtual Network CIDR Range",
Expand All @@ -313,6 +329,22 @@
{
"regex": "^(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\/(1[0-9]|2[0-4]))$",
"message": "Invalid CIDR range. The address prefix must be in the range [10,24]."
},
{
"isValid": "[if(greaterOrEquals(last(split(steps('networking').hubVirtualNetwork.superNetworkAddressCidrRange, '/')), 8), equals(last(take(split(first(split(steps('networking').hubVirtualNetwork.superNetworkAddressCidrRange, '/')), '.'), 1)), last(take(split(first(split(steps('networking').hubVirtualNetwork.virtualNetworkAddressCidrRange, '/')), '.'), 1))), true)]",
"message": "CIDR range not within super network CIDR range (first octet)."
},
{
"isValid": "[if(greaterOrEquals(last(split(steps('networking').hubVirtualNetwork.superNetworkAddressCidrRange, '/')), 16), equals(last(take(split(first(split(steps('networking').hubVirtualNetwork.superNetworkAddressCidrRange, '/')), '.'), 2)), last(take(split(first(split(steps('networking').hubVirtualNetwork.virtualNetworkAddressCidrRange, '/')), '.'), 2))), true)]",
"message": "CIDR range not within super network CIDR range (second octet)."
},
{
"isValid": "[if(greaterOrEquals(last(split(steps('networking').hubVirtualNetwork.superNetworkAddressCidrRange, '/')), 24), equals(last(take(split(first(split(steps('networking').hubVirtualNetwork.superNetworkAddressCidrRange, '/')), '.'), 3)), last(take(split(first(split(steps('networking').hubVirtualNetwork.virtualNetworkAddressCidrRange, '/')), '.'), 3))), true)]",
"message": "CIDR range not within super network CIDR range (third octet)."
},
{
"isValid": "[lessOrEquals(last(split(steps('networking').hubVirtualNetwork.superNetworkAddressCidrRange, '/')), last(split(steps('networking').hubVirtualNetwork.virtualNetworkAddressCidrRange, '/')))]",
"message": "CIDR range not within super network CIDR range (subnet mask)."
}
]
}
Expand Down Expand Up @@ -958,6 +990,7 @@
"operationsSubscriptionId": "[replace(steps('basics').operationsSection.operationsSubscriptionId, '/subscriptions/', '')]",
"sharedServicesSubscriptionId": "[replace(steps('basics').sharedServicesSection.sharedServicesSubscriptionId, '/subscriptions/', '')]",
"location": "[steps('basics').locationSection.location]",
"firewallSupernetIPAddress": "[steps('networking').hubVirtualNetwork.superNetworkAddressCidrRange]",
"tags": "[if(not(contains(steps('tags').tagsByResource, 'MissionLandingZone')), parse('{}'), first(map(parse(concat('[', string(steps('tags').tagsByResource), ']')), (item) => item.MissionLandingZone)))]",
"hubVirtualNetworkAddressPrefix": "[steps('networking').hubVirtualNetwork.virtualNetworkAddressCidrRange]",
"hubSubnetAddressPrefix": "[steps('networking').hubVirtualNetwork.subnetAddressCidrRange]",
Expand Down

0 comments on commit 4181681

Please sign in to comment.