-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
don't use module for subscription scoped template
Signed-off-by: Gerd Oberlechner <[email protected]>
- Loading branch information
Showing
4 changed files
with
27 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@export() | ||
var tokenManagementRoleName = 'token-mgmt-role' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,28 @@ | ||
@description('Defines if the ACR token management role should be created') | ||
param manageTokenRole bool | ||
|
||
module tokenMgmtRole '../modules/acr/token-mgmt-role.bicep' = if (manageTokenRole) { | ||
name: 'acr-token-mgmt-role' | ||
scope: subscription() | ||
import * as tmr from '../modules/acr/token-role-name.bicep' | ||
|
||
resource tokenManagementRole 'Microsoft.Authorization/roleDefinitions@2022-04-01' = if (manageTokenRole) { | ||
name: guid(tmr.tokenManagementRoleName) | ||
properties: { | ||
roleName: 'ARO HCP ACR Token Management' | ||
type: 'customRole' | ||
assignableScopes: [ | ||
subscription().id | ||
] | ||
description: 'This role allows the management of tokens in the ACR' | ||
permissions: [ | ||
{ | ||
actions: [ | ||
'Microsoft.ContainerRegistry/registries/tokens/read' | ||
'Microsoft.ContainerRegistry/registries/tokens/write' | ||
'Microsoft.ContainerRegistry/registries/tokens/delete' | ||
'Microsoft.ContainerRegistry/registries/generateCredentials/action' | ||
'Microsoft.ContainerRegistry/registries/tokens/operationStatuses/read' | ||
'Microsoft.ContainerRegistry/registries/scopeMaps/read' | ||
] | ||
} | ||
] | ||
} | ||
} |