Skip to content

Commit 3abf55e

Browse files
committed
Synchronize repo from Repoman
1 parent b710ec9 commit 3abf55e

File tree

3 files changed

+15
-70
lines changed

3 files changed

+15
-70
lines changed

.azdo/pipelines/terraform/java/azure-dev.yml

Lines changed: 0 additions & 68 deletions
This file was deleted.

infra/core/host/aks.bicep

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ param agentPoolConfig object = {}
9696
@description('Id of the user or app to assign application roles')
9797
param principalId string = ''
9898

99+
@description('The type of principal to assign application roles')
100+
@allowed(['Device','ForeignGroup','Group','ServicePrincipal','User'])
101+
param principalType string = 'User'
102+
99103
@description('Kubernetes Version')
100104
param kubernetesVersion string = '1.27.7'
101105

@@ -204,11 +208,12 @@ module containerRegistryAccess '../security/registry-access.bicep' = {
204208
}
205209

206210
// Give AKS cluster access to the specified principal
207-
module clusterAccess '../security/aks-managed-cluster-access.bicep' = if (enableAzureRbac || disableLocalAccounts) {
211+
module clusterAccess '../security/aks-managed-cluster-access.bicep' = if (!empty(principalId) && (enableAzureRbac || disableLocalAccounts)) {
208212
name: 'cluster-access'
209213
params: {
210214
clusterName: managedCluster.outputs.clusterName
211215
principalId: principalId
216+
principalType: principalType
212217
}
213218
}
214219

infra/core/security/aks-managed-cluster-access.bicep

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
11
metadata description = 'Assigns RBAC role to the specified AKS cluster and principal.'
2+
3+
@description('The AKS cluster name used as the target of the role assignments.')
24
param clusterName string
5+
6+
@description('The principal ID to assign the role to.')
37
param principalId string
48

9+
@description('The principal type to assign the role to.')
10+
@allowed(['Device','ForeignGroup','Group','ServicePrincipal','User'])
11+
param principalType string = 'User'
12+
513
var aksClusterAdminRole = subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'b1ff04bb-8a4e-4dc4-8eb5-8693973ce19b')
614

715
resource aksRole 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
816
scope: aksCluster // Use when specifying a scope that is different than the deployment scope
917
name: guid(subscription().id, resourceGroup().id, principalId, aksClusterAdminRole)
1018
properties: {
1119
roleDefinitionId: aksClusterAdminRole
12-
principalType: 'User'
20+
principalType: principalType
1321
principalId: principalId
1422
}
1523
}

0 commit comments

Comments
 (0)