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

Feature: Added new deployment toggles to hub-spoke #699

Merged
merged 15 commits into from
Jan 10, 2024

Conversation

oZakari
Copy link
Contributor

@oZakari oZakari commented Dec 7, 2023

Overview/Summary

Add additional deployment toggles for the hub-spoke module for feature parity with the VWAN module.

This PR fixes/adds/changes/removes

  1. Added VPN and ER gateway deployment toggles

Breaking Changes

  1. None

Testing Evidence

Validated the following with both parVpnGatewayConfig and parExpressRouteGatewayConfig objects containing data:

  • When testing with parVpnGatewayEnabled to true and parExpressRouteGatewayEnabled. Only VPN GW resources provisioned.
  • When testing with parVpnGatewayEnabled to false and parExpressRouteGatewayEnabled false. Only ER GW resources provisioned.
  • When both params set to true both sets of resources created.
  • When both params set to false, both sets of resources not provisioned.

As part of this Pull Request I have

@oZakari oZakari marked this pull request as draft December 7, 2023 06:09
@oZakari oZakari marked this pull request as ready for review December 7, 2023 06:46
@oZakari oZakari marked this pull request as draft December 7, 2023 06:46
@oZakari oZakari closed this Dec 7, 2023
@oZakari oZakari reopened this Dec 7, 2023
@oZakari oZakari marked this pull request as ready for review December 7, 2023 07:01
@oZakari
Copy link
Contributor Author

oZakari commented Dec 7, 2023

/azp run validateazcloud

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@FallenHoot
Copy link
Contributor

FallenHoot commented Dec 7, 2023

The following is missing to make this work as it is now. Without this, it will check if a subnet is created with GatewaySubnet

resource resGatewaySubnetRef 'Microsoft.Network/virtualNetworks/subnets@2023-02-01' existing = if (parVpnGatewayEnabled || parExpressRouteGatewayEnabled) {
  parent: resHubVnet
  name: 'GatewaySubnet'
}

I also noticed that varVpnGwConfig and varErGwConfig will deploy the PublicIP by default. I want to leave the code in for GwConfig, because maybe I want to use it later. With the toggles/boolean, we are now able to remove the check if empty and simple check if true/false. If it is false, then it gives the json('{"name": "noconfigVpn"}'). Resulting in Gateway Public IP to not being created.

var varVpnGwConfig = ((parVpnGatewayEnabled) ? parVpnGatewayConfig : json('{"name": "noconfigVpn"}'))

var varErGwConfig = ((parExpressRouteGatewayEnabled) ? parExpressRouteGatewayConfig : json('{"name": "noconfigEr"}'))

Also, a minor wording issue:

@sys.description('Switch to enable/disable VPN virtual network gateway deployment.')
param parExpressRouteGatewayEnabled bool = true

Should say.

@sys.description('Switch to enable/disable ExpressRoute virtual network gateway deployment.')
param parExpressRouteGatewayEnabled bool = true

@oZakari
Copy link
Contributor Author

oZakari commented Dec 8, 2023

Thanks @FallenHoot, as mentioned in Teams thread, going to open separate PR for subnet related changes. Have included your other recommendations though.

@oZakari
Copy link
Contributor Author

oZakari commented Dec 8, 2023

/azp run validateazcloud

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@oZakari oZakari removed the request for review from 4pplied January 8, 2024 20:06
Copy link
Collaborator

@jtracey93 jtracey93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of comments

@oZakari oZakari merged commit f019dff into Azure:main Jan 10, 2024
7 checks passed
marcosgm added a commit to marcosgm/ALZ-Bicep that referenced this pull request Jan 11, 2024
Feature: Added new deployment toggles to hub-spoke (Azure#699)
@oZakari oZakari deleted the additional-toggles branch June 26, 2024 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants