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

feat: Updated Network Manager module to support Routing Configuration feature #4096

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

ahmadabdalla
Copy link
Contributor

@ahmadabdalla ahmadabdalla commented Dec 29, 2024

Description

Azure Virtual Network Manager (AVNM) recently introduced a new feature that allows users to configure routing settings for their virtual networks. See concept-user-defined-route documentation.

ℹ️ Routing Configuration is Generally Available in many Azure regions: See UDR Management - General Availability. Given the optional usage of this feature, This should not impact existing usage of AVNM.

While enabling this feature, the following had to be updated on the module:

  • Added new child modules for routing-configuration, rule-collection and rule.
  • Updated the API to 2024-05-01 as per (https://learn.microsoft.com/en-us/azure/templates/microsoft.network/networkmanagers?pivots=deployment-language-bicep)
  • Updated module version.
  • Use of the common types for roleAssignments and locks.
  • Update the scope access to become optional as AVNM now enables a None feature mode to support capabilities like IPAM and Virtual Network Verifier.
  • Updated built in role name from IPAM Pool Contributor to IPAM Pool User, Still keeps the same GUID.
  • Added support for memberType for Subnets for Network Groups to support the new routing feature. However, set the default to virtual network as it is the common scenario.
  • Updated the default test case to not use any features.
  • Expanded on the max test case coverage to include the routing feature and added different network groups of subnet types.
  • Expanded on usage of the import functionality to reduce code duplication and import types from child module to parents.

Pipeline Reference

Pipeline
avm.res.network.network-manager

Type of Change

  • Update to CI Environment or utilities (Non-module affecting changes)
  • Azure Verified Module updates:
    • Bugfix containing backwards-compatible bug fixes, and I have NOT bumped the MAJOR or MINOR version in version.json:
      • Someone has opened a bug report issue, and I have included "Closes #{bug_report_issue_number}" in the PR description.
      • The bug was found by the module author, and no one has opened an issue to report it yet.
    • Feature update backwards compatible feature updates, and I have bumped the MINOR version in version.json.
    • Breaking changes and I have bumped the MAJOR version in version.json.
    • Update to documentation

Checklist

  • I'm sure there are no other open Pull Requests for the same update/change
  • I have run Set-AVMModule locally to generate the supporting module files.
  • My corresponding pipelines / checks run clean and green without any errors or warnings

@ahmadabdalla ahmadabdalla self-assigned this Dec 29, 2024

Important

The "Needs: Triage 🔍" label must be removed once the triage process is complete!

Tip

For additional guidance on how to triage this issue/PR, see the BRM Issue Triage documentation.

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Triage 🔍 Maintainers need to triage still Type: AVM 🅰️ ✌️ Ⓜ️ This is an AVM related issue labels Dec 29, 2024

Important

If this is a module-related PR, being submitted by the sole owner of the module, the AVM core team must review and approve it (as module owners can't approve their own PRs).

To indicate this PR needs the core team''s attention, apply the "Needs: Core Team 🧞" label!

The core team will only review and approve PRs that have this label applied!

@ahmadabdalla ahmadabdalla marked this pull request as ready for review December 29, 2024 06:11
@ahmadabdalla ahmadabdalla requested review from a team as code owners December 29, 2024 06:11
@avm-team-linter avm-team-linter bot added the Needs: Core Team 🧞 This item needs the AVM Core Team to review it label Dec 29, 2024
@ahmadabdalla ahmadabdalla enabled auto-merge (squash) December 29, 2024 06:12
}[]?

type networkManagerScopeAccessType = ('Connectivity' | 'SecurityAdmin')[]
type networkManagerScopeAccessType = ('Connectivity' | 'SecurityAdmin' | 'Routing')[]?
Copy link
Contributor

@AlexanderSehr AlexanderSehr Jan 7, 2025

Choose a reason for hiding this comment

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

Suggested change
type networkManagerScopeAccessType = ('Connectivity' | 'SecurityAdmin' | 'Routing')[]?
type networkManagerScopeAccessType = ('Connectivity' | 'SecurityAdmin' | 'Routing')

As per soon to be released specs, both the array and nullable indicators should be set at the parameter, not the UDT-side. The reasoning is simply to make it easier to understand a parameter/property by looking at it.

So this change should go along with updating the parameter to

param networkManagerScopeAccesses networkManagerScopeAccessType[]?

Copy link
Contributor

Choose a reason for hiding this comment

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

Note: The same idea applies to all other types

params: {
name: routingConfiguration.name
networkManagerName: networkManager.name
description: routingConfiguration.?description ?? ''
Copy link
Contributor

Choose a reason for hiding this comment

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

Are the fallback defaults here intended? If not provided for a nullable parameter they just won't be used. In other words: I'd only recommend setting a fallback default here if you definitely want to not pass null.

name: ruleCollection.name
description: ruleCollection.?description ?? ''
appliesTo: ruleCollection.appliesTo
disableBgpRoutePropagation: ruleCollection.?disableBgpRoutePropagation ?? true
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
disableBgpRoutePropagation: ruleCollection.?disableBgpRoutePropagation ?? true
disableBgpRoutePropagation: ruleCollection.?disableBgpRoutePropagation

Redundant as the deployment will default to the parameters default (true) regardless if not provided.

Copy link
Contributor

@AlexanderSehr AlexanderSehr left a comment

Choose a reason for hiding this comment

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

Great work @ahmadabdalla, as always. Really only have an ask regarding the declaration of arrays & nullable for UDTs if you can make room for it :)

@AlexanderSehr AlexanderSehr self-assigned this Jan 7, 2025
@AlexanderSehr AlexanderSehr added Class: Resource Module 📦 This is a resource module and removed Needs: Triage 🔍 Maintainers need to triage still labels Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Class: Resource Module 📦 This is a resource module Needs: Core Team 🧞 This item needs the AVM Core Team to review it Type: AVM 🅰️ ✌️ Ⓜ️ This is an AVM related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants