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

fix: avm/res/network/erport broken user defined type #4473

Merged
merged 5 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 34 additions & 35 deletions avm/res/network/express-route-port/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,14 @@ module expressRoutePort 'br/public:avm/res/network/express-route-port:<version>'
// Non-required parameters
billingType: 'MeteredData'
encapsulation: 'Dot1Q'
links: []
links: [
{
name: 'link1'
properties: {
adminState: 'Disabled'
}
}
]
location: '<location>'
lock: {
kind: 'CanNotDelete'
Expand Down Expand Up @@ -176,7 +183,14 @@ module expressRoutePort 'br/public:avm/res/network/express-route-port:<version>'
"value": "Dot1Q"
},
"links": {
"value": []
"value": [
{
"name": "link1",
"properties": {
"adminState": "Disabled"
}
}
]
},
"location": {
"value": "<location>"
Expand Down Expand Up @@ -229,7 +243,14 @@ param peeringLocation = 'Airtel-Chennai2-CLS'
// Non-required parameters
param billingType = 'MeteredData'
param encapsulation = 'Dot1Q'
param links = []
param links = [
{
name: 'link1'
properties: {
adminState: 'Disabled'
}
}
]
param location = '<location>'
param lock = {
kind: 'CanNotDelete'
Expand Down Expand Up @@ -346,6 +367,7 @@ param peeringLocation = 'Airtel-Chennai2-CLS'
| [`location`](#parameter-location) | string | Location for all resources. |
| [`lock`](#parameter-lock) | object | The lock settings of the service. |
| [`roleAssignments`](#parameter-roleassignments) | array | Array of role assignments to create. |
| [`tags`](#parameter-tags) | object | Tags of the resource. |

### Parameter: `bandwidthInGbps`

Expand Down Expand Up @@ -432,25 +454,13 @@ The name of the link to be created.

- Required: Yes
- Type: string
- Allowed:
```Bicep
[
'string'
]
```

### Parameter: `links.id`

Resource Id of the existing Link.

- Required: No
- Type: string
- Allowed:
```Bicep
[
'string'
]
```

### Parameter: `links.properties`

Expand All @@ -463,7 +473,7 @@ Properties of the Link.

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`adminState`](#parameter-linkspropertiesadminstate) | string | Administrative state of the physical port. |
| [`adminState`](#parameter-linkspropertiesadminstate) | string | Administrative state of the physical port. Must be set to 'Disabled' for initial deployment. |

**Optional parameters**

Expand All @@ -473,16 +483,10 @@ Properties of the Link.

### Parameter: `links.properties.adminState`

Administrative state of the physical port.
Administrative state of the physical port. Must be set to 'Disabled' for initial deployment.

- Required: Yes
- Type: string
- Allowed:
```Bicep
[
'string'
]
```

### Parameter: `links.properties.macSecConfig`

Expand All @@ -506,12 +510,6 @@ Keyvault Secret Identifier URL containing Mac security CAK key.

- Required: Yes
- Type: string
- Allowed:
```Bicep
[
'string'
]
```

### Parameter: `links.properties.macSecConfig.cipher`

Expand All @@ -535,12 +533,6 @@ Keyvault Secret Identifier URL containing Mac security CKN key.

- Required: Yes
- Type: string
- Allowed:
```Bicep
[
'string'
]
```

### Parameter: `links.properties.macSecConfig.sciState`

Expand Down Expand Up @@ -704,6 +696,13 @@ The principal type of the assigned principal ID.
]
```

### Parameter: `tags`

Tags of the resource.

- Required: No
- Type: object

## Outputs

| Output | Type | Description |
Expand Down
18 changes: 11 additions & 7 deletions avm/res/network/express-route-port/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ param roleAssignments roleAssignmentType[]?
@description('Optional. Location for all resources.')
param location string = resourceGroup().location

@description('Optional. Tags of the resource.')
param tags object?

var builtInRoleNames = {
Contributor: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'b24988ac-6180-42a0-ab88-20f7382dd24c')
'Network Contributor': subscriptionResourceId(
Expand Down Expand Up @@ -103,6 +106,7 @@ resource expressRoutePort_lock 'Microsoft.Authorization/locks@2020-05-01' = if (
resource expressRoutePort 'Microsoft.Network/ExpressRoutePorts@2024-05-01' = {
name: name
location: location
tags: tags
properties: {
bandwidthInGbps: bandwidthInGbps
billingType: billingType
Expand All @@ -121,7 +125,7 @@ resource expressRoutePort_roleAssignments 'Microsoft.Authorization/roleAssignmen
description: roleAssignment.?description
principalType: roleAssignment.?principalType
condition: roleAssignment.?condition
conditionVersion: !empty(roleAssignment.?condition) ? (roleAssignment.?conditionVersion ?? '2.0') : null // Must only be set if condtion is set
conditionVersion: !empty(roleAssignment.?condition) ? (roleAssignment.?conditionVersion ?? '2.0') : null // Must only be set if condition is set
delegatedManagedIdentityResourceId: roleAssignment.?delegatedManagedIdentityResourceId
}
scope: expressRoutePort
Expand All @@ -148,26 +152,26 @@ output location string = expressRoutePort.location
@description('The type for a link.')
type linkType = {
@description('Optional. Resource Id of the existing Link.')
id: 'string'?
id: string?

@description('Required. The name of the link to be created.')
name: 'string'
name: string

@description('Optional. Properties of the Link.')
properties: {
@description('Required. Administrative state of the physical port.')
adminState: 'string'
@description('Required. Administrative state of the physical port. Must be set to \'Disabled\' for initial deployment.')
adminState: string

@description('Optional. MacSec Configuration of the link.')
macSecConfig: {
@description('Required. Keyvault Secret Identifier URL containing Mac security CAK key.')
cakSecretIdentifier: 'string'
cakSecretIdentifier: string

@description('Required. Mac security cipher.')
cipher: ('GcmAes128' | 'GcmAes256' | 'GcmAesXpn128' | 'GcmAesXpn256')

@description('Required. Keyvault Secret Identifier URL containing Mac security CKN key.')
cknSecretIdentifier: 'string'
cknSecretIdentifier: string

@description('Required. Sci mode.')
sciState: ('Enabled' | 'Disabled')
Expand Down
29 changes: 11 additions & 18 deletions avm/res/network/express-route-port/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": "13147305000786724307"
"version": "0.33.13.18514",
"templateHash": "12646697926659678830"
},
"name": "ExpressRoute Ports",
"description": "This module deploys an Express Route Port resource used by Express Route Direct."
Expand All @@ -17,19 +17,13 @@
"properties": {
"id": {
"type": "string",
"allowedValues": [
"string"
],
"nullable": true,
"metadata": {
"description": "Optional. Resource Id of the existing Link."
}
},
"name": {
"type": "string",
"allowedValues": [
"string"
],
"metadata": {
"description": "Required. The name of the link to be created."
}
Expand All @@ -39,21 +33,15 @@
"properties": {
"adminState": {
"type": "string",
"allowedValues": [
"string"
],
"metadata": {
"description": "Required. Administrative state of the physical port."
"description": "Required. Administrative state of the physical port. Must be set to 'Disabled' for initial deployment."
}
},
"macSecConfig": {
"type": "object",
"properties": {
"cakSecretIdentifier": {
"type": "string",
"allowedValues": [
"string"
],
"metadata": {
"description": "Required. Keyvault Secret Identifier URL containing Mac security CAK key."
}
Expand All @@ -72,9 +60,6 @@
},
"cknSecretIdentifier": {
"type": "string",
"allowedValues": [
"string"
],
"metadata": {
"description": "Required. Keyvault Secret Identifier URL containing Mac security CKN key."
}
Expand Down Expand Up @@ -294,6 +279,13 @@
"metadata": {
"description": "Optional. Location for all resources."
}
},
"tags": {
"type": "object",
"nullable": true,
"metadata": {
"description": "Optional. Tags of the resource."
}
}
},
"variables": {
Expand Down Expand Up @@ -353,6 +345,7 @@
"apiVersion": "2024-05-01",
"name": "[parameters('name')]",
"location": "[parameters('location')]",
"tags": "[parameters('tags')]",
"properties": {
"bandwidthInGbps": "[parameters('bandwidthInGbps')]",
"billingType": "[parameters('billingType')]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,14 @@ module testDeployment '../../../main.bicep' = [
bandwidthInGbps: 10
billingType: 'MeteredData'
encapsulation: 'Dot1Q'
links: []
links: [
{
name: 'link1'
properties: {
adminState: 'Disabled'
}
}
]
lock: {
kind: 'CanNotDelete'
name: 'myCustomLockName'
Expand Down
2 changes: 1 addition & 1 deletion avm/res/network/express-route-port/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.1",
"version": "0.2",
"pathFilters": [
"./main.json"
]
Expand Down