Azure / Azure/Azure-Verified-Modules

[Module Proposal]: `avm/res/authorization/role-assignments/rg-scope`

Open
#2,601 3 comments 0 reactions 0 assignees View on GitHub
Language: Bicep :muscle: Needs: Module Owner :mega: Needs: Triage :mag: Type: New Module Proposal :bulb:
Dominant language
PowerShell
Stars
580
Forks
161
Avg merge
11h 3m
Merged PRs (30d)
15

Description

### Check for previous/existing GitHub issues/module proposals

- [x] I have checked for previous/existing GitHub issues/module proposals.

### Check this module doesn't already exist in the module indexes

- [x] I have checked for that this module doesn't already exist in the module indexes.

### Bicep or Terraform?

Bicep

### Module Classification?

Resource Module

### Module Name

avm/res/authorization/role-assignments/rg-scope

### Module Details

I find myself doing this in a few places:
```bicep
import { roleAssignmentType } from 'br/public:avm/utl/types/avm-common-types:0.7.0'
param resourceGroupRoleAssignments roleAssignmentType[]?

module resourceGroupRoleAssignment 'br/public:avm/res/authorization/role-assignment/rg-scope:0.1.1' = [
for (roleAssignment, index) in resourceGroupRoleAssignments ?? []: {
name: 'resourceGroupRoleAssignment-${index}'
params: {
roleDefinitionIdOrName: roleAssignment.roleDefinitionIdOrName
principalId: roleAssignment.principalId
description: roleAssignment.?description
principalType: roleAssignment.?principalType
condition: roleAssignment.?condition
conditionVersion: roleAssignment.?conditionVersion
delegatedManagedIdentityResourceId: roleAssignment.?delegatedManagedIdentityResourceId
}
}
]
```

It would be nice if there was a version that takes a roleAssignmentType[] directly.:
```bicep
import { roleAssignmentType } from 'br/public:avm/utl/types/avm-common-types:0.7.0'
param resourceGroupRoleAssignments roleAssignmentType[]?

module resourceGroupRoleAssignment 'br/public:avm/res/authorization/role-assignments/rg-scope:x.y.z' = {
params: {
roleAssignmentType: resourceGroupRoleAssignments
}
}
```

### Do you want to be the owner of this module?

No

### Module Owner's GitHub Username (handle)

_No response_

### (Optional) Secondary Module Owner's GitHub Username (handle)

_No response_

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by inspecting the existing br/public:avm/res/authorization/role-assignment/rg-scope:0.1.1 module and the AVM module indexes. Confirm the conventions for resource modules and roleAssignmentType, then define the new role-assignments/rg-scope module so it accepts the array directly and verify it is published and indexed as requested.

Written by the indexing model from the issue text.

Assessment

Domain
cloud, infrastructure
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.