Skip to content
New issue

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

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

Already on GitHub? # to your account

Users/torivara/virtual network gateways update #405

Merged
42 changes: 20 additions & 22 deletions arm/Microsoft.Network/virtualNetworkGateways/deploy.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ param gatewayPipName array = []
param publicIPPrefixId string = ''

@description('Optional. Specifies the zones of the Public IP address.')
param publicIpZones array = [
'1'
]
param publicIpZones array = []

@description('Optional. DNS name(s) of the Public IP resource(s). If you enabled active-active configuration, you need to provide 2 DNS names, if you want to use this feature. A region specific suffix will be appended to it, e.g.: your-DNS-name.westeurope.cloudapp.azure.com')
param domainNameLabel array = []
Expand Down Expand Up @@ -266,8 +264,8 @@ var vpnClientConfiguration = {
vpnClientAddressPoolPrefix
]
}
vpnClientRootCertificates: (empty(clientRootCertData) ? json('null') : vpnClientRootCertificates)
vpnClientRevokedCertificates: (empty(clientRevokedCertThumbprint) ? json('null') : vpmClientRevokedCertificates)
vpnClientRootCertificates: (empty(clientRootCertData) ? null : vpnClientRootCertificates)
vpnClientRevokedCertificates: (empty(clientRevokedCertThumbprint) ? null : vpmClientRevokedCertificates)
}

module pid_cuaId '.bicep/nested_cuaId.bicep' = if (!empty(cuaId)) {
Expand All @@ -287,10 +285,10 @@ resource virtualGatewayPublicIP 'Microsoft.Network/publicIPAddresses@2021-02-01'
}
properties: {
publicIPAllocationMethod: gatewayPipAllocationMethod
publicIPPrefix: ((!empty(publicIPPrefixId)) ? publicIPPrefix : json('null'))
dnsSettings: ((length(virtualGatewayPipName_var) == length(domainNameLabel)) ? json('{"domainNameLabel": "${domainNameLabel[index]}"}') : json('null'))
publicIPPrefix: ((!empty(publicIPPrefixId)) ? publicIPPrefix : null)
dnsSettings: ((length(virtualGatewayPipName_var) == length(domainNameLabel)) ? json('{"domainNameLabel": "${domainNameLabel[index]}"}') : null)
}
zones: publicIpZones
zones: (contains(zoneRedundantSkus, virtualNetworkGatewaySku) ? publicIpZones : null)
}]

@batchSize(1)
Expand All @@ -307,12 +305,12 @@ resource virtualGatewayPublicIP_lock 'Microsoft.Authorization/locks@2016-09-01'
resource virtualNetworkGatewayPublicIp_diagnosticSettings 'Microsoft.Insights/diagnosticsettings@2017-05-01-preview' = [for (virtualGatewayPublicIpName, index) in virtualGatewayPipName_var: if ((!empty(diagnosticStorageAccountId)) || (!empty(workspaceId)) || (!empty(eventHubAuthorizationRuleId)) || (!empty(eventHubName))) {
name: '${virtualGatewayPublicIpName}-diagnosticSettings'
properties: {
storageAccountId: (empty(diagnosticStorageAccountId) ? json('null') : diagnosticStorageAccountId)
workspaceId: (empty(workspaceId) ? json('null') : workspaceId)
eventHubAuthorizationRuleId: (empty(eventHubAuthorizationRuleId) ? json('null') : eventHubAuthorizationRuleId)
eventHubName: (empty(eventHubName) ? json('null') : eventHubName)
metrics: ((empty(diagnosticStorageAccountId) && empty(workspaceId) && empty(eventHubAuthorizationRuleId) && empty(eventHubName)) ? json('null') : diagnosticsMetrics)
logs: ((empty(diagnosticStorageAccountId) && empty(workspaceId) && empty(eventHubAuthorizationRuleId) && empty(eventHubName)) ? json('null') : publicIpDiagnosticsLogs)
storageAccountId: (empty(diagnosticStorageAccountId) ? null : diagnosticStorageAccountId)
workspaceId: (empty(workspaceId) ? null : workspaceId)
eventHubAuthorizationRuleId: (empty(eventHubAuthorizationRuleId) ? null : eventHubAuthorizationRuleId)
eventHubName: (empty(eventHubName) ? null : eventHubName)
metrics: ((empty(diagnosticStorageAccountId) && empty(workspaceId) && empty(eventHubAuthorizationRuleId) && empty(eventHubName)) ? null : diagnosticsMetrics)
logs: ((empty(diagnosticStorageAccountId) && empty(workspaceId) && empty(eventHubAuthorizationRuleId) && empty(eventHubName)) ? null : publicIpDiagnosticsLogs)
}
scope: virtualGatewayPublicIP[index]
}]
Expand All @@ -327,14 +325,14 @@ resource virtualNetworkGateway 'Microsoft.Network/virtualNetworkGateways@2021-02
ipConfigurations: (activeActive_var ? activeActiveIpConfiguration : activePassiveIpConfiguration)
activeActive: activeActive_var
enableBgp: enableBgp_var
bgpSettings: ((virtualNetworkGatewayType == 'ExpressRoute') ? json('null') : bgpSettings)
bgpSettings: ((virtualNetworkGatewayType == 'ExpressRoute') ? null : bgpSettings)
sku: {
name: virtualNetworkGatewaySku
tier: virtualNetworkGatewaySku
}
gatewayType: virtualNetworkGatewayType
vpnType: vpnType_var
vpnClientConfiguration: (empty(vpnClientAddressPoolPrefix) ? json('null') : vpnClientConfiguration)
vpnClientConfiguration: (empty(vpnClientAddressPoolPrefix) ? null : vpnClientConfiguration)
}
dependsOn: [
virtualGatewayPublicIP
Expand All @@ -353,12 +351,12 @@ resource virtualNetworkGateway_lock 'Microsoft.Authorization/locks@2016-09-01' =
resource virtualNetworkGateway_diagnosticSettings 'Microsoft.Insights/diagnosticsettings@2017-05-01-preview' = if ((!empty(diagnosticStorageAccountId)) || (!empty(workspaceId)) || (!empty(eventHubAuthorizationRuleId)) || (!empty(eventHubName))) {
name: '${virtualNetworkGateway.name}-diagnosticSettings'
properties: {
storageAccountId: (empty(diagnosticStorageAccountId) ? json('null') : diagnosticStorageAccountId)
workspaceId: (empty(workspaceId) ? json('null') : workspaceId)
eventHubAuthorizationRuleId: (empty(eventHubAuthorizationRuleId) ? json('null') : eventHubAuthorizationRuleId)
eventHubName: (empty(eventHubName) ? json('null') : eventHubName)
metrics: ((empty(diagnosticStorageAccountId) && empty(workspaceId) && empty(eventHubAuthorizationRuleId) && empty(eventHubName)) ? json('null') : diagnosticsMetrics)
logs: ((empty(diagnosticStorageAccountId) && empty(workspaceId) && empty(eventHubAuthorizationRuleId) && empty(eventHubName)) ? json('null') : virtualNetworkGatewayDiagnosticsLogs)
storageAccountId: (empty(diagnosticStorageAccountId) ? null : diagnosticStorageAccountId)
workspaceId: (empty(workspaceId) ? null : workspaceId)
eventHubAuthorizationRuleId: (empty(eventHubAuthorizationRuleId) ? null : eventHubAuthorizationRuleId)
eventHubName: (empty(eventHubName) ? null : eventHubName)
metrics: ((empty(diagnosticStorageAccountId) && empty(workspaceId) && empty(eventHubAuthorizationRuleId) && empty(eventHubName)) ? null : diagnosticsMetrics)
logs: ((empty(diagnosticStorageAccountId) && empty(workspaceId) && empty(eventHubAuthorizationRuleId) && empty(eventHubName)) ? null : virtualNetworkGatewayDiagnosticsLogs)
}
scope: virtualNetworkGateway
}
Expand Down
2 changes: 1 addition & 1 deletion arm/Microsoft.Network/virtualNetworkGateways/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ This module deploys a Virtual Network Gateway.
| `metricsToEnable` | array | `[AllMetrics]` | `[AllMetrics]` | Optional. The name of metrics that will be streamed. |
| `publicIpLogsToEnable` | array | `[DDoSProtectionNotifications, DDoSMitigationFlowLogs, DDoSMitigationReports]` | `[DDoSProtectionNotifications, DDoSMitigationFlowLogs, DDoSMitigationReports]` | Optional. The name of logs that will be streamed. |
| `publicIPPrefixId` | string | | | Optional. Resource Id of the Public IP Prefix object. This is only needed if you want your Public IPs created in a PIP Prefix. |
| `publicIpZones` | array | `[1]` | | Optional. Specifies the zones of the Public IP address. |
| `publicIpZones` | array | `[]` | | Optional. Specifies the zones of the Public IP address. Basic IP SKU does not support Availability Zones.|
| `roleAssignments` | array | `[]` | | Optional. Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11' |
| `tags` | object | `{object}` | | Optional. Tags of the resource. |
| `virtualNetworkGatewayLogsToEnable` | array | `[GatewayDiagnosticLog, TunnelDiagnosticLog, RouteDiagnosticLog, IKEDiagnosticLog, P2SDiagnosticLog]` | `[GatewayDiagnosticLog, TunnelDiagnosticLog, RouteDiagnosticLog, IKEDiagnosticLog, P2SDiagnosticLog]` | Optional. The name of logs that will be streamed. |
Expand Down