diff --git a/avm/res/network/express-route-port/README.md b/avm/res/network/express-route-port/README.md index f53ab6f595..bd7c23ebb1 100644 --- a/avm/res/network/express-route-port/README.md +++ b/avm/res/network/express-route-port/README.md @@ -117,7 +117,14 @@ module expressRoutePort 'br/public:avm/res/network/express-route-port:' // Non-required parameters billingType: 'MeteredData' encapsulation: 'Dot1Q' - links: [] + links: [ + { + name: 'link1' + properties: { + adminState: 'Disabled' + } + } + ] location: '' lock: { kind: 'CanNotDelete' @@ -176,7 +183,14 @@ module expressRoutePort 'br/public:avm/res/network/express-route-port:' "value": "Dot1Q" }, "links": { - "value": [] + "value": [ + { + "name": "link1", + "properties": { + "adminState": "Disabled" + } + } + ] }, "location": { "value": "" @@ -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 = '' param lock = { kind: 'CanNotDelete' @@ -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` @@ -432,12 +454,6 @@ The name of the link to be created. - Required: Yes - Type: string -- Allowed: - ```Bicep - [ - 'string' - ] - ``` ### Parameter: `links.id` @@ -445,12 +461,6 @@ Resource Id of the existing Link. - Required: No - Type: string -- Allowed: - ```Bicep - [ - 'string' - ] - ``` ### Parameter: `links.properties` @@ -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** @@ -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` @@ -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` @@ -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` @@ -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 | diff --git a/avm/res/network/express-route-port/main.bicep b/avm/res/network/express-route-port/main.bicep index 8882ad138e..c06b135b6e 100644 --- a/avm/res/network/express-route-port/main.bicep +++ b/avm/res/network/express-route-port/main.bicep @@ -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( @@ -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 @@ -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 @@ -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') diff --git a/avm/res/network/express-route-port/main.json b/avm/res/network/express-route-port/main.json index ac0e613091..859b8f17c8 100644 --- a/avm/res/network/express-route-port/main.json +++ b/avm/res/network/express-route-port/main.json @@ -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." @@ -17,9 +17,6 @@ "properties": { "id": { "type": "string", - "allowedValues": [ - "string" - ], "nullable": true, "metadata": { "description": "Optional. Resource Id of the existing Link." @@ -27,9 +24,6 @@ }, "name": { "type": "string", - "allowedValues": [ - "string" - ], "metadata": { "description": "Required. The name of the link to be created." } @@ -39,11 +33,8 @@ "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": { @@ -51,9 +42,6 @@ "properties": { "cakSecretIdentifier": { "type": "string", - "allowedValues": [ - "string" - ], "metadata": { "description": "Required. Keyvault Secret Identifier URL containing Mac security CAK key." } @@ -72,9 +60,6 @@ }, "cknSecretIdentifier": { "type": "string", - "allowedValues": [ - "string" - ], "metadata": { "description": "Required. Keyvault Secret Identifier URL containing Mac security CKN key." } @@ -294,6 +279,13 @@ "metadata": { "description": "Optional. Location for all resources." } + }, + "tags": { + "type": "object", + "nullable": true, + "metadata": { + "description": "Optional. Tags of the resource." + } } }, "variables": { @@ -353,6 +345,7 @@ "apiVersion": "2024-05-01", "name": "[parameters('name')]", "location": "[parameters('location')]", + "tags": "[parameters('tags')]", "properties": { "bandwidthInGbps": "[parameters('bandwidthInGbps')]", "billingType": "[parameters('billingType')]", diff --git a/avm/res/network/express-route-port/tests/e2e/max/main.test.bicep b/avm/res/network/express-route-port/tests/e2e/max/main.test.bicep index cce053cfe6..81db35fdd4 100644 --- a/avm/res/network/express-route-port/tests/e2e/max/main.test.bicep +++ b/avm/res/network/express-route-port/tests/e2e/max/main.test.bicep @@ -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' diff --git a/avm/res/network/express-route-port/version.json b/avm/res/network/express-route-port/version.json index 8def869ede..daf1a794d9 100644 --- a/avm/res/network/express-route-port/version.json +++ b/avm/res/network/express-route-port/version.json @@ -1,6 +1,6 @@ { "$schema": "https://aka.ms/bicep-registry-module-version-file-schema#", - "version": "0.1", + "version": "0.2", "pathFilters": [ "./main.json" ]