Skip to content

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

@jachin84

Description

@jachin84

Check for previous/existing GitHub issues/module proposals

  • I have checked for previous/existing GitHub issues/module proposals.

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

  • 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:

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.:

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Proposed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions