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: New module azure-stack-hci/logical-network module #4464

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

Conversation

xhy8759
Copy link

@xhy8759 xhy8759 commented Feb 17, 2025

Description

Pipeline Reference

Pipeline
avm.res.azure-stack-hci.logical-network

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

@xhy8759 xhy8759 requested review from a team as code owners February 17, 2025 06:49
@avm-team-linter avm-team-linter bot added the Needs: Core Team 🧞 This item needs the AVM Core Team to review it label Feb 17, 2025
@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 Feb 17, 2025
@xhy8759
Copy link
Author

xhy8759 commented Feb 18, 2025

If there is no this line ('avm/res/azure-stack-hci/logical-network' # Failing on resource deletion when trying to delete RBAC at subscription level) is action.yml, the removal would fail.
Here is the failed pipeline:
https://github.com/Infrastructure-as-code-Automation/bicep-registry-modules/actions/runs/13383281833

@xhy8759 xhy8759 changed the title feat: New module azure-stack-hci/logicalnetwork module feat: New module azure-stack-hci/logical-network module Feb 20, 2025
@xhy8759
Copy link
Author

xhy8759 commented Feb 20, 2025

@@ -75,6 +75,7 @@ runs:
$exceptionModulePaths = @(
'avm/ptn/lz/sub-vending' # Failing on resource deletion when trying to delete RBAC at subscription level (hub-spoke test)
'avm/res/azure-stack-hci/cluster' # Failing on resource deletion when trying to delete RBAC at subscription level
'avm/res/azure-stack-hci/logical-network' # Failing on resource deletion when trying to delete RBAC at subscription level
Copy link
Contributor

@AlexanderSehr AlexanderSehr Feb 21, 2025

Choose a reason for hiding this comment

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

Hey @xhy8759,
thank you for your contribution 💪
For this change, I take it you tested it first without adding the module to this list of exeptions? As the module is deploying role assignments, I'd not be surprised, but it's also not failing for all modules 😄

Comment on lines +46 to +48
param ipConfigurationReferences array = [
/*array of type {ID: string}*/
]
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of the comment, it would by highly recommnded to instead use a user-defined type like

param ipConfigurationReferences ipConfigurationReferenceType[]?

@export()
@description('The type for an IP configuration reference.')
type ipConfigurationReferenceType = {
  @description('Required. The resource ID of something')
  resourceId: string
}

resource logicalNetwork 'Microsoft.AzureStackHCI/logicalNetworks@2024-05-01-preview' = {
  (...)
          ipConfigurationReferences: map((ipConfigurationReferences ?? []), (ipConfigurationReference) => { id: ipConfigurationReference.resourceId })
  (...)
}

'Microsoft.Authorization/roleDefinitions',
'18d7d88d-d35e-4fb5-a5c3-7773c20a72d9'
)
'Role Based Access Control Administrator (Preview)': subscriptionResourceId(
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
'Role Based Access Control Administrator (Preview)': subscriptionResourceId(
'Role Based Access Control Administrator': subscriptionResourceId(

location: enforcedLocation
}

module nestedDependencies '../../../../cluster/tests/e2e/defaults/dependencies.bicep' = {
Copy link
Contributor

Choose a reason for hiding this comment

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

hey @eriqua,
should this be allowed? It's referencing the test setup of the cluster module (also part of azure-stack-hci). I guess duplicating the entire code base is also not ideal. So maybe the scripts should be moved to the shared test assets?

@description('Required. The service principal ID of the service principal used for the Azure Stack HCI Resource Bridge deployment.')
@secure()
#disable-next-line secure-parameter-default
param arbDeploymentSPObjectId string = ''
Copy link
Contributor

Choose a reason for hiding this comment

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

Hey @xhy8759, any additional inputs to take not of, that were not already part of the hci-cluster module?

scope: resourceGroup
params: {
name: '${namePrefix}${serviceShort}logicalnetwork'
location: enforcedLocation
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
location: enforcedLocation

Comment on lines +192 to +201
customLocationId: customLocation.id
vmSwitchName: 'ConvergedSwitch(management)'
ipAllocationMethod: 'Static'
addressPrefix: '172.20.0.1/24'
startingAddress: '172.20.0.171'
endingAddress: '172.20.0.190'
defaultGateway: '172.20.0.1'
dnsServers: ['172.20.0.1']
routeName: 'default'
vlanId: null
Copy link
Contributor

Choose a reason for hiding this comment

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

Please note that this test must provide only the required parameters, but contains a lot of optional ones right now. Please remove those so that we can validate the defaults work. Hence the name 😉

Comment on lines +201 to +212
name: '${namePrefix}${serviceShort}logicalnetwork'
location: enforcedLocation
customLocationId: customLocation.id
vmSwitchName: 'ConvergedSwitch(management)'
ipAllocationMethod: 'Static'
addressPrefix: '172.20.0.1/24'
startingAddress: '172.20.0.171'
endingAddress: '172.20.0.190'
defaultGateway: '172.20.0.1'
dnsServers: ['172.20.0.1']
routeName: 'default'
vlanId: null
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar comment to the one in the defaults test. Are all these parameters needed to show how to deploy the module in a WAF-aligned way?
I think what you want is a 3rd test cases that sets these values (usually something we refer to as the max test)

Copy link
Contributor

Choose a reason for hiding this comment

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

Note, that max test should then also contain test for e.g. the role assignments (which is something you can copy from other modules in this repository)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Core Team 🧞 This item needs the AVM Core Team to review it Needs: Triage 🔍 Maintainers need to triage still Type: AVM 🅰️ ✌️ Ⓜ️ This is an AVM related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants