Skip to content

Commit

Permalink
refactor: Allow option to specify virtual network gateway ip configur…
Browse files Browse the repository at this point in the history
…ation names (#921)

* fix: Add missing private dns zones to applicable policy assignment and module  (#903)

* Fix private dns zone list in policy assignment

* Remove unused dns zone ids and update param names

* Remove unused dns zone ids and update param names

* Update generated docs

* Add param to accelerator

* Generate Parameter Markdowns [oZakari/1618d0f4]

* Fix value for param

* Add prefix to dependabot title

* Update test values

* Updated param table

* Generate Parameter Markdowns [oZakari/640a1dbc]

* Update logic

* Update spacing

* Add params to parameter file

* Generate Parameter Markdowns [oZakari/0a582834]

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>

* Transition back vnetGatewayConfig reference

* Generate Parameter Markdowns [oZakari/c151f035]

* Remove duplicate `parPrivateDnsZonesLocation` entry.

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
oZakari and github-actions[bot] authored Jan 7, 2025
1 parent f025098 commit 04b3a3a
Show file tree
Hide file tree
Showing 10 changed files with 81 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -735,15 +735,15 @@ Switch to enable/disable VPN virtual network gateway deployment in secondary loc

Configuration for VPN virtual network gateway to be deployed.

- Default value: `@{name=[format('{0}-Vpn-Gateway-{1}', parameters('parCompanyPrefix'), parameters('parLocation'))]; gatewayType=Vpn; sku=VpnGw1; vpnType=RouteBased; generation=Generation1; enableBgp=False; activeActive=False; enableBgpRouteTranslationForNat=False; enableDnsForwarding=False; bgpPeeringAddress=; bgpsettings=; vpnClientConfiguration=}`
- Default value: `@{name=[format('{0}-Vpn-Gateway-{1}', parameters('parCompanyPrefix'), parameters('parLocation'))]; gatewayType=Vpn; sku=VpnGw1; vpnType=RouteBased; generation=Generation1; enableBgp=False; activeActive=False; enableBgpRouteTranslationForNat=False; enableDnsForwarding=False; bgpPeeringAddress=; bgpsettings=; vpnClientConfiguration=; ipConfigurationName=vnetGatewayConfig; ipConfigurationActiveActiveName=vnetGatewayConfig2}`

### parVpnGatewayConfigSecondaryLocation

![Parameter Setting](https://img.shields.io/badge/parameter-optional-green?style=flat-square)

Configuration for VPN virtual network gateway to be deployed in secondary location.

- Default value: `@{name=[format('{0}-Vpn-Gateway-{1}', parameters('parCompanyPrefix'), parameters('parSecondaryLocation'))]; gatewayType=Vpn; sku=VpnGw1; vpnType=RouteBased; generation=Generation1; enableBgp=False; activeActive=False; enableBgpRouteTranslationForNat=False; enableDnsForwarding=False; bgpPeeringAddress=; bgpsettings=; vpnClientConfiguration=}`
- Default value: `@{name=[format('{0}-Vpn-Gateway-{1}', parameters('parCompanyPrefix'), parameters('parSecondaryLocation'))]; gatewayType=Vpn; sku=VpnGw1; vpnType=RouteBased; generation=Generation1; enableBgp=False; activeActive=False; enableBgpRouteTranslationForNat=False; enableDnsForwarding=False; bgpPeeringAddress=; bgpsettings=; vpnClientConfiguration=; ipConfigurationName=vnetGatewayConfig; ipConfigurationActiveActiveName=vnetGatewayConfig2}`

### parExpressRouteGatewayEnabled

Expand All @@ -767,15 +767,15 @@ Switch to enable/disable ExpressRoute virtual network gateway deployment in seco

Configuration for ExpressRoute virtual network gateway to be deployed.

- Default value: `@{name=[format('{0}-ExpressRoute-Gateway', parameters('parCompanyPrefix'))]; gatewayType=ExpressRoute; sku=ErGw1AZ; vpnType=RouteBased; vpnGatewayGeneration=None; enableBgp=False; activeActive=False; enableBgpRouteTranslationForNat=False; enableDnsForwarding=False; bgpPeeringAddress=; bgpsettings=}`
- Default value: `@{name=[format('{0}-ExpressRoute-Gateway', parameters('parCompanyPrefix'))]; gatewayType=ExpressRoute; sku=ErGw1AZ; vpnType=RouteBased; vpnGatewayGeneration=None; enableBgp=False; activeActive=False; enableBgpRouteTranslationForNat=False; enableDnsForwarding=False; bgpPeeringAddress=; bgpsettings=; ipConfigurationName=vnetGatewayConfig; ipConfigurationActiveActiveName=vnetGatewayConfig2}`

### parExpressRouteGatewayConfigSecondaryLocation

![Parameter Setting](https://img.shields.io/badge/parameter-optional-green?style=flat-square)

Configuration for ExpressRoute virtual network gateway to be deployed in secondary location.

- Default value: `@{name=[format('{0}-ExpressRoute-Gateway', parameters('parCompanyPrefix'))]; gatewayType=ExpressRoute; sku=ErGw1AZ; vpnType=RouteBased; vpnGatewayGeneration=None; enableBgp=False; activeActive=False; enableBgpRouteTranslationForNat=False; enableDnsForwarding=False; bgpPeeringAddress=; bgpsettings=}`
- Default value: `@{name=[format('{0}-ExpressRoute-Gateway', parameters('parCompanyPrefix'))]; gatewayType=ExpressRoute; sku=ErGw1AZ; vpnType=RouteBased; vpnGatewayGeneration=None; enableBgp=False; activeActive=False; enableBgpRouteTranslationForNat=False; enableDnsForwarding=False; bgpPeeringAddress=; bgpsettings=; ipConfigurationName=vnetGatewayConfig; ipConfigurationActiveActiveName=vnetGatewayConfig2}`

### parVirtualNetworkGatewayLock

Expand Down Expand Up @@ -1173,7 +1173,9 @@ outBastionNsgNameSecondaryLocation | string |
"bgpPeeringAddress": "",
"peerWeight": 5
},
"vpnClientConfiguration": {}
"vpnClientConfiguration": {},
"ipConfigurationName": "vnetGatewayConfig",
"ipConfigurationActiveActiveName": "vnetGatewayConfig2"
}
},
"parVpnGatewayConfigSecondaryLocation": {
Expand All @@ -1193,7 +1195,9 @@ outBastionNsgNameSecondaryLocation | string |
"bgpPeeringAddress": "",
"peerWeight": 5
},
"vpnClientConfiguration": {}
"vpnClientConfiguration": {},
"ipConfigurationName": "vnetGatewayConfig",
"ipConfigurationActiveActiveName": "vnetGatewayConfig2"
}
},
"parExpressRouteGatewayEnabled": {
Expand All @@ -1218,7 +1222,9 @@ outBastionNsgNameSecondaryLocation | string |
"asn": "65515",
"bgpPeeringAddress": "",
"peerWeight": "5"
}
},
"ipConfigurationName": "vnetGatewayConfig",
"ipConfigurationActiveActiveName": "vnetGatewayConfig2"
}
},
"parExpressRouteGatewayConfigSecondaryLocation": {
Expand All @@ -1237,7 +1243,9 @@ outBastionNsgNameSecondaryLocation | string |
"asn": "65515",
"bgpPeeringAddress": "",
"peerWeight": "5"
}
},
"ipConfigurationName": "vnetGatewayConfig",
"ipConfigurationActiveActiveName": "vnetGatewayConfig2"
}
},
"parVirtualNetworkGatewayLock": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ Switch to enable/disable VPN virtual network gateway deployment.

Configuration for VPN virtual network gateway to be deployed.

- Default value: `@{name=[format('{0}-Vpn-Gateway', parameters('parCompanyPrefix'))]; gatewayType=Vpn; sku=VpnGw1; vpnType=RouteBased; generation=Generation1; enableBgp=False; activeActive=False; enableBgpRouteTranslationForNat=False; enableDnsForwarding=False; bgpPeeringAddress=; bgpsettings=; vpnClientConfiguration=}`
- Default value: `@{name=[format('{0}-Vpn-Gateway', parameters('parCompanyPrefix'))]; gatewayType=Vpn; sku=VpnGw1; vpnType=RouteBased; generation=Generation1; enableBgp=False; activeActive=False; enableBgpRouteTranslationForNat=False; enableDnsForwarding=False; bgpPeeringAddress=; bgpsettings=; vpnClientConfiguration=; ipConfigurationName=vnetGatewayConfig; ipConfigurationActiveActiveName=vnetGatewayConfig2}`

### parExpressRouteGatewayEnabled

Expand All @@ -470,7 +470,7 @@ Switch to enable/disable ExpressRoute virtual network gateway deployment.

Configuration for ExpressRoute virtual network gateway to be deployed.

- Default value: `@{name=[format('{0}-ExpressRoute-Gateway', parameters('parCompanyPrefix'))]; gatewayType=ExpressRoute; sku=ErGw1AZ; vpnType=RouteBased; vpnGatewayGeneration=None; enableBgp=False; activeActive=False; enableBgpRouteTranslationForNat=False; enableDnsForwarding=False; bgpPeeringAddress=; bgpsettings=}`
- Default value: `@{name=[format('{0}-ExpressRoute-Gateway', parameters('parCompanyPrefix'))]; gatewayType=ExpressRoute; sku=ErGw1AZ; vpnType=RouteBased; vpnGatewayGeneration=None; enableBgp=False; activeActive=False; enableBgpRouteTranslationForNat=False; enableDnsForwarding=False; bgpPeeringAddress=; bgpsettings=; ipConfigurationName=vnetGatewayConfig; ipConfigurationActiveActiveName=vnetGatewayConfig2}`

### parVirtualNetworkGatewayLock

Expand Down Expand Up @@ -733,7 +733,9 @@ outBastionNsgName | string |
"bgpPeeringAddress": "",
"peerWeight": 5
},
"vpnClientConfiguration": {}
"vpnClientConfiguration": {},
"ipConfigurationName": "vnetGatewayConfig",
"ipConfigurationActiveActiveName": "vnetGatewayConfig2"
}
},
"parExpressRouteGatewayEnabled": {
Expand All @@ -755,7 +757,9 @@ outBastionNsgName | string |
"asn": "65515",
"bgpPeeringAddress": "",
"peerWeight": "5"
}
},
"ipConfigurationName": "vnetGatewayConfig",
"ipConfigurationActiveActiveName": "vnetGatewayConfig2"
}
},
"parVirtualNetworkGatewayLock": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,8 @@ param parVpnGatewayConfig object = {
peerWeight: 5
}
vpnClientConfiguration: {}
ipConfigurationName: 'vnetGatewayConfig'
ipConfigurationActiveActiveName: 'vnetGatewayConfig2'
}

//ASN must be 65515 if deploying VPN & ER for co-existence to work: https://docs.microsoft.com/en-us/azure/expressroute/expressroute-howto-coexist-resource-manager#limits-and-limitations
Expand All @@ -475,6 +477,8 @@ param parVpnGatewayConfigSecondaryLocation object = {
peerWeight: 5
}
vpnClientConfiguration: {}
ipConfigurationName: 'vnetGatewayConfig'
ipConfigurationActiveActiveName: 'vnetGatewayConfig2'
}

@sys.description('Switch to enable/disable ExpressRoute virtual network gateway deployment.')
Expand All @@ -500,6 +504,8 @@ param parExpressRouteGatewayConfig object = {
bgpPeeringAddress: ''
peerWeight: '5'
}
ipConfigurationName: 'vnetGatewayConfig'
ipConfigurationActiveActiveName: 'vnetGatewayConfig2'
}

@sys.description('Configuration for ExpressRoute virtual network gateway to be deployed in secondary location.')
Expand All @@ -519,6 +525,8 @@ param parExpressRouteGatewayConfigSecondaryLocation object = {
bgpPeeringAddress: ''
peerWeight: '5'
}
ipConfigurationName: 'vnetGatewayConfig'
ipConfigurationActiveActiveName: 'vnetGatewayConfig2'
}

@sys.description('''Resource Lock Configuration for ExpressRoute Virtual Network Gateway.
Expand Down Expand Up @@ -1422,7 +1430,7 @@ resource resGateway 'Microsoft.Network/virtualNetworkGateways@2024-01-01' = [
[
{
id: resHubVnet.id
name: 'vnetGatewayConfig1'
name: gateway.ipConfigurationName
properties: {
publicIPAddress: {
id: modGatewayPublicIp[i].outputs.outPublicIpId // Primary Public IP
Expand All @@ -1438,7 +1446,7 @@ resource resGateway 'Microsoft.Network/virtualNetworkGateways@2024-01-01' = [
? [
{
id: resHubVnet.id
name: 'vnetGatewayConfig2'
name: gateway.ipConfigurationActiveActiveName
properties: {
publicIPAddress: {
id: modGatewayPublicIpActiveActive[i].outputs.outPublicIpId // Secondary Public IP
Expand Down Expand Up @@ -1492,7 +1500,7 @@ resource resGatewaySecondaryLocation 'Microsoft.Network/virtualNetworkGateways@2
[
{
id: resHubVnetSecondaryLocation.id
name: 'vnetGatewayConfig1'
name: gateway.ipConfigurationName
properties: {
publicIPAddress: {
id: modGatewayPublicIpSecondaryLocation[i].outputs.outPublicIpId // Primary Public IP
Expand All @@ -1508,7 +1516,7 @@ resource resGatewaySecondaryLocation 'Microsoft.Network/virtualNetworkGateways@2
? [
{
id: resHubVnetSecondaryLocation.id
name: 'vnetGatewayConfig2'
name: gateway.ipConfigurationActiveActiveName
properties: {
publicIPAddress: {
id: modGatewayPublicIpActiveActiveSecondaryLocation[i].outputs.outPublicIpId // Secondary Public IP
Expand Down
8 changes: 6 additions & 2 deletions infra-as-code/bicep/modules/hubNetworking/hubNetworking.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,8 @@ param parVpnGatewayConfig object = {
peerWeight: 5
}
vpnClientConfiguration: {}
ipConfigurationName: 'vnetGatewayConfig'
ipConfigurationActiveActiveName: 'vnetGatewayConfig2'
}

@sys.description('Switch to enable/disable ExpressRoute virtual network gateway deployment.')
Expand All @@ -323,6 +325,8 @@ param parExpressRouteGatewayConfig object = {
bgpPeeringAddress: ''
peerWeight: '5'
}
ipConfigurationName: 'vnetGatewayConfig'
ipConfigurationActiveActiveName: 'vnetGatewayConfig2'
}

@sys.description('''Resource Lock Configuration for ExpressRoute Virtual Network Gateway.
Expand Down Expand Up @@ -791,7 +795,7 @@ resource resGateway 'Microsoft.Network/virtualNetworkGateways@2024-01-01' = [
[
{
id: resHubVnet.id
name: 'vnetGatewayConfig1'
name: gateway.ipConfigurationName
properties: {
publicIPAddress: {
id: modGatewayPublicIp[i].outputs.outPublicIpId // Primary Public IP
Expand All @@ -807,7 +811,7 @@ resource resGateway 'Microsoft.Network/virtualNetworkGateways@2024-01-01' = [
? [
{
id: resHubVnet.id
name: 'vnetGatewayConfig2'
name: gateway.ipConfigurationActiveActiveName
properties: {
publicIPAddress: {
id: modGatewayPublicIpActiveActive[i].outputs.outPublicIpId // Secondary Public IP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@
"bgpPeeringAddress": "",
"peerWeight": "5"
},
"vpnClientConfiguration": {}
"vpnClientConfiguration": {},
"ipConfigurationName": "vnetGatewayConfig",
"ipConfigurationActiveActiveName": "vnetGatewayConfig2"
}
},
"parExpressRouteGatewayEnabled": {
Expand All @@ -159,7 +161,9 @@
"asn": "65515",
"bgpPeeringAddress": "",
"peerWeight": "5"
}
},
"ipConfigurationName": "vnetGatewayConfig",
"ipConfigurationActiveActiveName": "vnetGatewayConfig2"
}
},
"parTags": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@
"bgpPeeringAddress": "",
"peerWeight": "5"
},
"vpnClientConfiguration": {}
"vpnClientConfiguration": {},
"ipConfigurationName": "vnetGatewayConfig",
"ipConfigurationActiveActiveName": "vnetGatewayConfig2"
}
},
"parExpressRouteGatewayEnabled": {
Expand All @@ -171,7 +173,9 @@
"asn": "65515",
"bgpPeeringAddress": "",
"peerWeight": "5"
}
},
"ipConfigurationName": "vnetGatewayConfig",
"ipConfigurationActiveActiveName": "vnetGatewayConfig2"
}
},
"parTags": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,9 @@
"bgpPeeringAddress": "",
"peerWeight": "5"
},
"vpnClientConfiguration": {}
"vpnClientConfiguration": {},
"ipConfigurationName": "vnetGatewayConfig",
"ipConfigurationActiveActiveName": "vnetGatewayConfig2"
}
},
"parVpnGatewayConfigSecondaryLocation": {
Expand All @@ -284,7 +286,9 @@
"bgpPeeringAddress": "",
"peerWeight": "5"
},
"vpnClientConfiguration": {}
"vpnClientConfiguration": {},
"ipConfigurationName": "vnetGatewayConfig",
"ipConfigurationActiveActiveName": "vnetGatewayConfig2"
}
},
"parExpressRouteGatewayEnabled": {
Expand All @@ -306,7 +310,9 @@
"asn": "65515",
"bgpPeeringAddress": "",
"peerWeight": "5"
}
},
"ipConfigurationName": "vnetGatewayConfig",
"ipConfigurationActiveActiveName": "vnetGatewayConfig2"
}
},
"parExpressRouteGatewayEnabledSecondaryLocation": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@
"asn": "65515",
"bgpPeeringAddress": "",
"peerWeight": "5"
}
},
"ipConfigurationName": "vnetGatewayConfig",
"ipConfigurationActiveActiveName": "vnetGatewayConfig2"
}
},
"parExpressRouteGatewayEnabled": {
Expand All @@ -116,7 +118,9 @@
"asn": "65515",
"bgpPeeringAddress": "",
"peerWeight": "5"
}
},
"ipConfigurationName": "vnetGatewayConfig",
"ipConfigurationActiveActiveName": "vnetGatewayConfig2"
}
},
"parTelemetryOptOut": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,9 @@
"bgpPeeringAddress": "",
"peerWeight": "5"
},
"vpnClientConfiguration": {}
"vpnClientConfiguration": {},
"ipConfigurationName": "vnetGatewayConfig",
"ipConfigurationActiveActiveName": "vnetGatewayConfig2"
}
},
"parExpressRouteGatewayEnabled": {
Expand All @@ -192,7 +194,9 @@
"asn": "65515",
"bgpPeeringAddress": "",
"peerWeight": "5"
}
},
"ipConfigurationName": "vnetGatewayConfig",
"ipConfigurationActiveActiveName": "vnetGatewayConfig2"
}
},
"parTags": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@
"asn": "65515",
"bgpPeeringAddress": "",
"peerWeight": "5"
}
},
"ipConfigurationName": "vnetGatewayConfig",
"ipConfigurationActiveActiveName": "vnetGatewayConfig2"
}
},
"parExpressRouteGatewayEnabled": {
Expand All @@ -152,7 +154,9 @@
"asn": "65515",
"bgpPeeringAddress": "",
"peerWeight": "5"
}
},
"ipConfigurationName": "vnetGatewayConfig",
"ipConfigurationActiveActiveName": "vnetGatewayConfig2"
}
},
"parTelemetryOptOut": {
Expand Down

0 comments on commit 04b3a3a

Please sign in to comment.