Skip to content

Commit

Permalink
feat: Updates of avm/res/network/express-route-circuits (#4400)
Browse files Browse the repository at this point in the history
## Description

- Adds support for an optional list of authorizations.
- Adds output for authorizations as a flattened map.
- Adds output for the service provider provisioning state property.

<!--
>Thank you for your contribution !
> Please include a summary of the change and which issue is fixed.
> Please also include the context.
> List any dependencies that are required for this change.

Fixes #123
Fixes #456
Closes #123
Closes #456
-->

## Pipeline Reference

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

| Pipeline |
| -------- |
|
[![avm.res.network.express-route-circuit](https://github.com/thecmdradama/bicep-registry-modules/actions/workflows/avm.res.network.express-route-circuit.yml/badge.svg)](https://github.com/thecmdradama/bicep-registry-modules/actions/workflows/avm.res.network.express-route-circuit.yml)
|

## Type of Change

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

- [ ] Update to CI Environment or utilities (Non-module affecting
changes)
- [x] 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.
- [x] 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`.
  - [x] Update to documentation

## Checklist

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

<!-- Please keep up to date with the contribution guide at
https://aka.ms/avm/contribute/bicep -->
  • Loading branch information
thecmdradama authored Feb 11, 2025
1 parent 2672fd4 commit 19db33d
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 3 deletions.
10 changes: 10 additions & 0 deletions avm/res/network/express-route-circuit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,7 @@ param tags = {
| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`allowClassicOperations`](#parameter-allowclassicoperations) | bool | Allow classic operations. You can connect to virtual networks in the classic deployment model by setting allowClassicOperations to true. |
| [`authorizationNames`](#parameter-authorizationnames) | array | List of names for ExpressRoute circuit authorizations to create. To fetch the `authorizationKey` for the authorization, use the `existing` resource reference for `Microsoft.Network/expressRouteCircuits/authorizations`. |
| [`bandwidthInGbps`](#parameter-bandwidthingbps) | int | The bandwidth of the circuit when the circuit is provisioned on an ExpressRoutePort resource. Available when configuring Express Route Direct. Default value of 0 will set the property to null. |
| [`diagnosticSettings`](#parameter-diagnosticsettings) | array | The diagnostic settings of the service. |
| [`enableTelemetry`](#parameter-enabletelemetry) | bool | Enable/Disable usage telemetry for module. |
Expand Down Expand Up @@ -578,6 +579,14 @@ Allow classic operations. You can connect to virtual networks in the classic dep
- Type: bool
- Default: `False`

### Parameter: `authorizationNames`

List of names for ExpressRoute circuit authorizations to create. To fetch the `authorizationKey` for the authorization, use the `existing` resource reference for `Microsoft.Network/expressRouteCircuits/authorizations`.

- Required: No
- Type: array
- Default: `[]`

### Parameter: `bandwidthInGbps`

The bandwidth of the circuit when the circuit is provisioned on an ExpressRoutePort resource. Available when configuring Express Route Direct. Default value of 0 will set the property to null.
Expand Down Expand Up @@ -1014,6 +1023,7 @@ Specifies the identifier that is used to identify the customer.
| `resourceGroupName` | string | The resource group the express route curcuit was deployed into. |
| `resourceId` | string | The resource ID of express route curcuit. |
| `serviceKey` | string | The service key of the express route circuit. |
| `serviceProviderProvisioningState` | string | The service provider provisioning state of the express route circuit. |

## Data Collection

Expand Down
11 changes: 11 additions & 0 deletions avm/res/network/express-route-circuit/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ param location string = resourceGroup().location
@description('Optional. Allow classic operations. You can connect to virtual networks in the classic deployment model by setting allowClassicOperations to true.')
param allowClassicOperations bool = false

@description('Optional. List of names for ExpressRoute circuit authorizations to create. To fetch the `authorizationKey` for the authorization, use the `existing` resource reference for `Microsoft.Network/expressRouteCircuits/authorizations`.')
param authorizationNames string[] = []

@description('Optional. The bandwidth of the circuit when the circuit is provisioned on an ExpressRoutePort resource. Available when configuring Express Route Direct. Default value of 0 will set the property to null.')
param bandwidthInGbps int = 0

Expand Down Expand Up @@ -143,6 +146,11 @@ resource expressRouteCircuit 'Microsoft.Network/expressRouteCircuits@2023-04-01'
}
properties: {
allowClassicOperations: allowClassicOperations
authorizations: [
for authorizationName in authorizationNames: {
name: authorizationName
}
]
globalReachEnabled: globalReachEnabled
bandwidthInGbps: bandwidthInGbps != 0 ? bandwidthInGbps : null
expressRoutePort: !empty(expressRoutePortResourceId)
Expand Down Expand Up @@ -245,6 +253,9 @@ output name string = expressRouteCircuit.name
@description('The service key of the express route circuit.')
output serviceKey string = expressRouteCircuit.properties.serviceKey

@description('The service provider provisioning state of the express route circuit.')
output serviceProviderProvisioningState string = expressRouteCircuit.properties.serviceProviderProvisioningState

@description('The location the resource was deployed into.')
output location string = expressRouteCircuit.location

Expand Down
30 changes: 28 additions & 2 deletions avm/res/network/express-route-circuit/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "17484476736436996858"
"version": "0.33.93.31351",
"templateHash": "8776591928362518786"
},
"name": "ExpressRoute Circuits",
"description": "This module deploys an Express Route Circuit."
Expand Down Expand Up @@ -346,6 +346,16 @@
"description": "Optional. Allow classic operations. You can connect to virtual networks in the classic deployment model by setting allowClassicOperations to true."
}
},
"authorizationNames": {
"type": "array",
"items": {
"type": "string"
},
"defaultValue": [],
"metadata": {
"description": "Optional. List of names for ExpressRoute circuit authorizations to create. To fetch the `authorizationKey` for the authorization, use the `existing` resource reference for `Microsoft.Network/expressRouteCircuits/authorizations`."
}
},
"bandwidthInGbps": {
"type": "int",
"defaultValue": 0,
Expand Down Expand Up @@ -450,6 +460,15 @@
"family": "[if(equals(parameters('skuTier'), 'Local'), 'UnlimitedData', parameters('skuFamily'))]"
},
"properties": {
"copy": [
{
"name": "authorizations",
"count": "[length(parameters('authorizationNames'))]",
"input": {
"name": "[parameters('authorizationNames')[copyIndex('authorizations')]]"
}
}
],
"allowClassicOperations": "[parameters('allowClassicOperations')]",
"globalReachEnabled": "[parameters('globalReachEnabled')]",
"bandwidthInGbps": "[if(not(equals(parameters('bandwidthInGbps'), 0)), parameters('bandwidthInGbps'), null())]",
Expand Down Expand Up @@ -569,6 +588,13 @@
},
"value": "[reference('expressRouteCircuit').serviceKey]"
},
"serviceProviderProvisioningState": {
"type": "string",
"metadata": {
"description": "The service provider provisioning state of the express route circuit."
},
"value": "[reference('expressRouteCircuit').serviceProviderProvisioningState]"
},
"location": {
"type": "string",
"metadata": {
Expand Down
2 changes: 1 addition & 1 deletion avm/res/network/express-route-circuit/version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://aka.ms/bicep-registry-module-version-file-schema#",
"version": "0.3",
"version": "0.4",
"pathFilters": [
"./main.json"
]
Expand Down

0 comments on commit 19db33d

Please sign in to comment.