late-airplane-27955
10/15/2024, 5:19 PMvar ownerGroup = AzureAD.GetGroup.InvokeAsync(new()
{
DisplayName = ownerGroupName,
SecurityEnabled = true,
});
if (ownerGroup.Result.Id == null)
{
throw new ArgumentException($"group {ownerGroupName} not found");
}
var roleAssignment = new AzureNative.Authorization.RoleAssignment($"{rgName}Owner", new()
{
PrincipalId = ownerGroup.Result.Id.Split("/")[2], // id will be /groups/id, so get the id part
PrincipalType = AzureNative.Authorization.PrincipalType.Group,
Scope = thisRg.Id,
RoleDefinitionId = "/providers/Microsoft.Authorization/roleDefinitions/8e3af657-a8ff-443c-a75c-2fe8c4bcb635"
});
I'd like to replace the hardcoded RoleDefinitionId
with a looked up value from namemillions-journalist-34868
10/15/2024, 8:28 PMmillions-journalist-34868
10/15/2024, 8:31 PMlate-airplane-27955
10/16/2024, 8:15 AMNo matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.
Powered by