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

refactor: Allow option to specify virtual network gateway ip configuration names #921

Merged
merged 5 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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 @@ -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
Loading