Skip to content

Commit

Permalink
fix: Small token fixes (#1093)
Browse files Browse the repository at this point in the history
## Description

- Adjusted token handling
- Aligned local test file token replacement with workflow's
- Small typo fix in deploy action

> Note: Required me to register the `Microsoft.Network` provider at mgmt
group scope
([ref](hashicorp/terraform-provider-azurerm#24528))

## Pipeline Reference

<!-- Insert your Pipeline Status Badge below -->

| Pipeline |
| -------- |
|
[![avm.res.network.network-manager](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.network.network-manager.yml/badge.svg?branch=users%2Falsehr%2FnetworkManagerToken&event=workflow_dispatch)](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.network.network-manager.yml)
|

## Type of Change

<!-- Use the check-boxes [x] on the options that are relevant. -->

- [x] Update to CI Environment or utlities (Non-module effecting
changes)
- [ ] Azure Verified Module updates:
- [x] 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
  • Loading branch information
AlexanderSehr authored Feb 28, 2024
1 parent 85484c7 commit 371a12f
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ description: "Deploy module"

inputs:
modulePath:
descriptio: "The path to the module file directory used to determine the resource location"
description: "The path to the module file directory used to determine the resource location"
required: true
templateFilePath:
description: "The path to the template file to use for deployment"
Expand Down
13 changes: 9 additions & 4 deletions avm/res/network/network-manager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ This module deploys a Network Manager.
- [Parameters](#Parameters)
- [Outputs](#Outputs)
- [Cross-referenced modules](#Cross-referenced-modules)
- [Notes](#Notes)
- [Data Collection](#Data-Collection)

## Resource Types
Expand Down Expand Up @@ -127,7 +128,7 @@ module networkManager 'br/public:avm/res/network/network-manager:<version>' = {
]
networkManagerScopes: {
managementGroups: [
'/providers/Microsoft.Management/managementGroups/#_ARM_MGMTGROUP_ID_#'
'/providers/Microsoft.Management/managementGroups/#_managementGroupId_#'
]
}
// Non-required parameters
Expand Down Expand Up @@ -354,7 +355,7 @@ module networkManager 'br/public:avm/res/network/network-manager:<version>' = {
"networkManagerScopes": {
"value": {
"managementGroups": [
"/providers/Microsoft.Management/managementGroups/#_ARM_MGMTGROUP_ID_#"
"/providers/Microsoft.Management/managementGroups/#_managementGroupId_#"
]
}
},
Expand Down Expand Up @@ -678,7 +679,7 @@ module networkManager 'br/public:avm/res/network/network-manager:<version>' = {
| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`connectivityConfigurations`](#parameter-connectivityconfigurations) | array | Connectivity Configurations to create for the network manager. Network manager must contain at least one network group in order to define connectivity configurations. |
| [`description`](#parameter-description) | string | A description of the network manager. |
| [`description`](#parameter-description) | string | A description of the Network Manager. |
| [`enableTelemetry`](#parameter-enabletelemetry) | bool | Enable/Disable usage telemetry for module. |
| [`location`](#parameter-location) | string | Location for all resources. |
| [`lock`](#parameter-lock) | object | The lock settings of the service. |
Expand Down Expand Up @@ -726,7 +727,7 @@ Connectivity Configurations to create for the network manager. Network manager m

### Parameter: `description`

A description of the network manager.
A description of the Network Manager.

- Required: No
- Type: string
Expand Down Expand Up @@ -910,6 +911,10 @@ Tags of the resource.

_None_

## Notes

In order to deploy a Network Manager with the `networkManagerScopes` property set to `managementGroups`, you need to register the `Microsoft.Network` resource provider at the Management Group first ([ref](https://learn.microsoft.com/en-us/rest/api/resources/providers/register-at-management-group-scope)).

## Data Collection

The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the [repository](https://aka.ms/avm/telemetry). There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at <https://go.microsoft.com/fwlink/?LinkID=824704>. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.
2 changes: 1 addition & 1 deletion avm/res/network/network-manager/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ param roleAssignments roleAssignmentType
param tags object?

@maxLength(500)
@sys.description('Optional. A description of the network manager.')
@sys.description('Optional. A description of the Network Manager.')
param description string = ''

@sys.description('Required. Scope Access. String array containing any of "Connectivity", "SecurityAdmin". The connectivity feature allows you to create network topologies at scale. The security admin feature lets you create high-priority security rules, which take precedence over NSGs.')
Expand Down
2 changes: 1 addition & 1 deletion avm/res/network/network-manager/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
"defaultValue": "",
"maxLength": 500,
"metadata": {
"description": "Optional. A description of the network manager."
"description": "Optional. A description of the Network Manager."
}
},
"networkManagerScopeAccesses": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
]
networkManagerScopes: {
managementGroups: [
'/providers/Microsoft.Management/managementGroups/#_ARM_MGMTGROUP_ID_#'
// Note: Required the `Microsoft.Network` provider to be registered at management group level via `az provider register --namespace Microsoft.Network -m '<MgmtGroupName>'`
'/providers/Microsoft.Management/managementGroups/#_managementGroupId_#'
]
}
networkGroups: [
Expand Down Expand Up @@ -260,4 +261,7 @@ module testDeployment '../../../main.bicep' = [for iteration in [ 'init', 'idem'
Role: 'DeploymentValidation'
}
}
dependsOn: [
nestedDependencies
]
}]
6 changes: 6 additions & 0 deletions avm/utilities/tools/Test-ModuleLocally.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,12 @@ function Test-ModuleLocally {
# Add other template files as they may contain the 'moduleVersion'
$tokenConfiguration.FilePathList += (Get-ChildItem -Path $moduleRoot -Recurse -File).FullName | Where-Object { $_ -match '.+(main.json|main.bicep)$' }

# Default tokens
$tokenConfiguration.Tokens += @{
subscriptionId = $ValidateOrDeployParameters.SubscriptionId
managementGroupId = $ValidateOrDeployParameters.ManagementGroupId
}

# Add Other Parameter File Tokens (For Testing)
$AdditionalTokens.Keys | ForEach-Object {
$tokenConfiguration.Tokens[$PSItem] = $AdditionalTokens.$PSItem
Expand Down

0 comments on commit 371a12f

Please sign in to comment.