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: Update avm/res/dev-test-lab/lab to latest common UDT pattern and uplift version to 0.4 #3882

Merged
merged 9 commits into from
Dec 5, 2024
337 changes: 329 additions & 8 deletions avm/res/dev-test-lab/lab/README.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions avm/res/dev-test-lab/lab/artifactsource/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "13904061272597362111"
"version": "0.31.92.45157",
"templateHash": "14783992773855757023"
},
"name": "DevTest Lab Artifact Sources",
"description": "This module deploys a DevTest Lab Artifact Source.\r\n\r\nAn artifact source allows you to create custom artifacts for the VMs in the lab, or use Azure Resource Manager templates to create a custom test environment. You must add a private Git repository for the artifacts or Resource Manager templates that your team creates. The repository can be hosted on GitHub or on Azure DevOps Services.",
"description": "This module deploys a DevTest Lab Artifact Source.\n\nAn artifact source allows you to create custom artifacts for the VMs in the lab, or use Azure Resource Manager templates to create a custom test environment. You must add a private Git repository for the artifacts or Resource Manager templates that your team creates. The repository can be hosted on GitHub or on Azure DevOps Services.",
"owner": "Azure/module-maintainers"
},
"parameters": {
Expand Down
6 changes: 3 additions & 3 deletions avm/res/dev-test-lab/lab/cost/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "7509251296299887127"
"version": "0.31.92.45157",
"templateHash": "11453149540789698717"
},
"name": "DevTest Lab Costs",
"description": "This module deploys a DevTest Lab Cost.\r\n\r\nManage lab costs by setting a spending target that can be viewed in the Monthly Estimated Cost Trend chart. DevTest Labs can send a notification when spending reaches the specified target threshold.",
"description": "This module deploys a DevTest Lab Cost.\n\nManage lab costs by setting a spending target that can be viewed in the Monthly Estimated Cost Trend chart. DevTest Labs can send a notification when spending reaches the specified target threshold.",
"owner": "Azure/module-maintainers"
},
"parameters": {
Expand Down
47 changes: 8 additions & 39 deletions avm/res/dev-test-lab/lab/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ param name string
@description('Optional. Location for all Resources.')
param location string = resourceGroup().location

import { lockType } from 'br/public:avm/utl/types/avm-common-types:0.4.0'
@description('Optional. The lock settings of the service.')
param lock lockType
param lock lockType?

@description('Optional. Array of role assignment objects that contain the \'roleDefinitionIdOrName\' and \'principalIds\' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
param roleAssignments roleAssignmentType
import { roleAssignmentType } from 'br/public:avm/utl/types/avm-common-types:0.4.0'
@description('Optional. Array of role assignments to create.')
param roleAssignments roleAssignmentType[]?

@description('Optional. Tags of the resource.')
param tags object?
Expand Down Expand Up @@ -57,8 +59,9 @@ param premiumDataDisks string = 'Disabled'
@description('Optional. The properties of any lab support message associated with this lab.')
param support object = {}

import { managedIdentityOnlyUserAssignedType } from 'br/public:avm/utl/types/avm-common-types:0.4.0'
@description('Optional. The managed identity definition for this resource. For new labs created after 8/10/2020, the lab\'s system assigned identity is set to On by default and lab owner will not be able to turn this off for the lifecycle of the lab.')
param managedIdentities managedIdentitiesType
param managedIdentities managedIdentityOnlyUserAssignedType?

@description('Optional. The resource ID(s) to assign to the virtual machines associated with this lab.')
param managementIdentitiesResourceIds string[] = []
Expand Down Expand Up @@ -123,7 +126,7 @@ var formattedUserAssignedIdentities = reduce(
var identity = !empty(managedIdentities)
? {
type: !empty(managedIdentities.?userAssignedResourceIds ?? {}) ? 'SystemAssigned,UserAssigned' : 'SystemAssigned'
userAssignedIdentities: !empty(formattedUserAssignedIdentities) ? formattedUserAssignedIdentities : null
userAssignedIdentities: !empty(formattedUserAssignedIdentities) ? formattedUserAssignedIdentities : {}
}
: {
type: 'SystemAssigned'
Expand Down Expand Up @@ -379,40 +382,6 @@ type managedIdentitiesType = {
userAssignedResourceIds: string[]
}?

type lockType = {
@description('Optional. Specify the name of lock.')
name: string?

@description('Optional. Specify the type of lock.')
kind: ('CanNotDelete' | 'ReadOnly' | 'None')?
}?

type roleAssignmentType = {
@description('Optional. The name (as GUID) of the role assignment. If not provided, a GUID will be generated.')
name: string?

@description('Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
roleDefinitionIdOrName: string

@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
principalId: string

@description('Optional. The principal type of the assigned principal ID.')
principalType: ('ServicePrincipal' | 'Group' | 'User' | 'ForeignGroup' | 'Device')?

@description('Optional. The description of the role assignment.')
description: string?

@description('Optional. The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase "foo_storage_container".')
condition: string?

@description('Optional. Version of the condition.')
conditionVersion: '2.0'?

@description('Optional. The Resource Id of the delegated managed identity resource.')
delegatedManagedIdentityResourceId: string?
}[]?

type artifactsourcesType = {
@description('Required. The name of the artifact source.')
name: string
Expand Down
Loading
Loading