diff --git a/avm/res/app/managed-environment/README.md b/avm/res/app/managed-environment/README.md index 935d035505..6f20e777cf 100644 --- a/avm/res/app/managed-environment/README.md +++ b/avm/res/app/managed-environment/README.md @@ -791,6 +791,7 @@ Whether or not this Managed Environment is zone-redundant. | `name` | string | The name of the Managed Environment. | | `resourceGroupName` | string | The name of the resource group the Managed Environment was deployed into. | | `resourceId` | string | The resource ID of the Managed Environment. | +| `staticIp` | string | The IP address of the Managed Environment. | | `systemAssignedMIPrincipalId` | string | The principal ID of the system assigned identity. | ## Cross-referenced modules diff --git a/avm/res/app/managed-environment/main.bicep b/avm/res/app/managed-environment/main.bicep index c609ded715..c75f50c1c2 100644 --- a/avm/res/app/managed-environment/main.bicep +++ b/avm/res/app/managed-environment/main.bicep @@ -78,7 +78,6 @@ var formattedUserAssignedIdentities = reduce( (cur, next) => union(cur, next) ) // Converts the flat array to an object like { '${id1}': {}, '${id2}': {} } - var identity = !empty(managedIdentities) ? { type: (managedIdentities.?systemAssigned ?? false) @@ -102,30 +101,28 @@ var builtInRoleNames = { ) } -resource avmTelemetry 'Microsoft.Resources/deployments@2023-07-01' = - if (enableTelemetry) { - name: '46d3xbcp.res.app-managedenvironment.${replace('-..--..-', '.', '-')}.${substring(uniqueString(deployment().name, location), 0, 4)}' - properties: { - mode: 'Incremental' - template: { - '$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#' - contentVersion: '1.0.0.0' - resources: [] - outputs: { - telemetry: { - type: 'String' - value: 'For more information, see https://aka.ms/avm/TelemetryInfo' - } +resource avmTelemetry 'Microsoft.Resources/deployments@2023-07-01' = if (enableTelemetry) { + name: '46d3xbcp.res.app-managedenvironment.${replace('-..--..-', '.', '-')}.${substring(uniqueString(deployment().name, location), 0, 4)}' + properties: { + mode: 'Incremental' + template: { + '$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#' + contentVersion: '1.0.0.0' + resources: [] + outputs: { + telemetry: { + type: 'String' + value: 'For more information, see https://aka.ms/avm/TelemetryInfo' } } } } +} -resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2021-06-01' existing = - if (!empty(logAnalyticsWorkspaceResourceId)) { - name: last(split(logAnalyticsWorkspaceResourceId, '/'))! - scope: resourceGroup(split(logAnalyticsWorkspaceResourceId, '/')[2], split(logAnalyticsWorkspaceResourceId, '/')[4]) - } +resource logAnalyticsWorkspace 'Microsoft.OperationalInsights/workspaces@2021-06-01' existing = if (!empty(logAnalyticsWorkspaceResourceId)) { + name: last(split(logAnalyticsWorkspaceResourceId, '/'))! + scope: resourceGroup(split(logAnalyticsWorkspaceResourceId, '/')[2], split(logAnalyticsWorkspaceResourceId, '/')[4]) +} resource managedEnvironment 'Microsoft.App/managedEnvironments@2023-11-02-preview' = { name: name @@ -180,17 +177,16 @@ resource managedEnvironment_roleAssignments 'Microsoft.Authorization/roleAssignm } ] -resource managedEnvironment_lock 'Microsoft.Authorization/locks@2020-05-01' = - if (!empty(lock ?? {}) && lock.?kind != 'None') { - name: lock.?name ?? 'lock-${name}' - properties: { - level: lock.?kind ?? '' - notes: lock.?kind == 'CanNotDelete' - ? 'Cannot delete resource or child resources.' - : 'Cannot delete or modify the resource or child resources.' - } - scope: managedEnvironment +resource managedEnvironment_lock 'Microsoft.Authorization/locks@2020-05-01' = if (!empty(lock ?? {}) && lock.?kind != 'None') { + name: lock.?name ?? 'lock-${name}' + properties: { + level: lock.?kind ?? '' + notes: lock.?kind == 'CanNotDelete' + ? 'Cannot delete resource or child resources.' + : 'Cannot delete or modify the resource or child resources.' } + scope: managedEnvironment +} @description('The name of the resource group the Managed Environment was deployed into.') output resourceGroupName string = resourceGroup().name @@ -210,6 +206,9 @@ output systemAssignedMIPrincipalId string = managedEnvironment.?identity.?princi @description('The Default domain of the Managed Environment.') output defaultDomain string = managedEnvironment.properties.defaultDomain +@description('The IP address of the Managed Environment.') +output staticIp string = managedEnvironment.properties.staticIp + // =============== // // Definitions // // =============== // diff --git a/avm/res/app/managed-environment/main.json b/avm/res/app/managed-environment/main.json index 2eafa79846..667911e066 100644 --- a/avm/res/app/managed-environment/main.json +++ b/avm/res/app/managed-environment/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.27.1.19265", - "templateHash": "15666134926564437864" + "templateHash": "16221242216822493056" }, "name": "App ManagedEnvironments", "description": "This module deploys an App Managed Environment (also known as a Container App Environment).", @@ -436,6 +436,13 @@ "description": "The Default domain of the Managed Environment." }, "value": "[reference('managedEnvironment').defaultDomain]" + }, + "staticIp": { + "type": "string", + "metadata": { + "description": "The IP address of the Managed Environment." + }, + "value": "[reference('managedEnvironment').staticIp]" } } } \ No newline at end of file