Gallery › Network › Azure Community Policy
Allowed Virtual Network Gateway SKUs
Converted Policy Audit Deny Disabled Mode All Version 1.0.0
This policy enables you to specify a set of virtual network gateway SKUs that your organization can deploy.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONazurepolicy.json · 68 lines
{
"name": "fc775da0-219d-472c-b643-578b622a94c3",
"type": "Microsoft.Authorization/policyDefinitions",
"properties": {
"displayName": "Allowed Virtual Network Gateway SKUs",
"description": "This policy enables you to specify a set of virtual network gateway SKUs that your organization can deploy.",
"metadata": {
"version": "1.0.0",
"category": "Network"
},
"mode": "All",
"parameters": {
"listOfAllowedSKUs": {
"type": "Array",
"metadata": {
"description": "The list of SKUs that can be specified for virtual network gateways.",
"displayName": "Allowed SKUs"
}
},
"gatewayType": {
"type": "String",
"allowedValues": [
"Vpn",
"ExpressRoute"
],
"metadata": {
"displayName": "Gateway Type"
}
},
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "Deny, Audit or Disabled the execution of the Policy"
},
"allowedValues": [
"Deny",
"Audit",
"Disabled"
],
"defaultValue": "Audit"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Network/virtualNetworkGateways"
},
{
"field": "Microsoft.Network/virtualNetworkGateways/gatewayType",
"equals": "[parameters('gatewayType')]"
},
{
"not": {
"field": "Microsoft.Network/virtualNetworkGateways/sku.name",
"in": "[parameters('listOfAllowedSKUs')]"
}
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
}
}
}Bylawfc775da0-219d-472c-b643-578b622a94c3.bylaw.ps1 · 41 lines
# Converted from azurepolicy.json by ConvertTo-Bylaw.
Policy 'fc775da0-219d-472c-b643-578b622a94c3' {
Properties @{
DisplayName = 'Allowed Virtual Network Gateway SKUs'
Description = 'This policy enables you to specify a set of virtual network gateway SKUs that your organization can deploy.'
Version = '1.0.0'
Category = 'Network'
Mode = 'All'
}
Parameter ListOfAllowedSKUs @{
Type = 'Array'
DisplayName = 'Allowed SKUs'
Description = 'The list of SKUs that can be specified for virtual network gateways.'
}
Parameter GatewayType @{
Type = 'String'
AllowedValues = @('Vpn', 'ExpressRoute')
DisplayName = 'Gateway Type'
}
Parameter Effect @{
AllowedValues = @('Deny', 'Audit', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Deny, Audit or Disabled the execution of the Policy'
}
Resource 'Microsoft.Network/virtualNetworkGateways' {
When {
Field gatewayType | Must -Be (Param GatewayType)
}
Require 'sku.name is one of the ListOfAllowedSKUs parameter' {
Field sku.name | Must -BeIn (Param ListOfAllowedSKUs)
}
}
Effect (Param Effect)
}Source: policyDefinitions/Network/allowed-virtual-network-gateway-skus/azurepolicy.json in Azure/Community-Policy, under the MIT licence.
Bylaw