1. Packages
  2. Azure Active Directory (Azure AD)
  3. API Docs
  4. AccessPackageCatalogRoleAssignment
Azure Active Directory (Azure AD) v6.4.0 published on Monday, Apr 7, 2025 by Pulumi

azuread.AccessPackageCatalogRoleAssignment

Explore with Pulumi AI

Manages a single catalog role assignment within Azure Active Directory.

API Permissions

The following API permissions are required in order to use this resource.

When authenticated with a service principal, this resource requires one of the following application roles: EntitlementManagement.ReadWrite.All or Directory.ReadWrite.All

When authenticated with a user principal, this resource requires one of the following directory roles: Identity Governance administrator or Global Administrator

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azuread from "@pulumi/azuread";

const example = azuread.getUser({
    userPrincipalName: "jdoe@example.com",
});
const exampleGetAccessPackageCatalogRole = azuread.getAccessPackageCatalogRole({
    displayName: "Catalog owner",
});
const exampleAccessPackageCatalog = new azuread.AccessPackageCatalog("example", {
    displayName: "example-access-package-catalog",
    description: "Example access package catalog",
});
const exampleAccessPackageCatalogRoleAssignment = new azuread.AccessPackageCatalogRoleAssignment("example", {
    roleId: exampleGetAccessPackageCatalogRole.then(exampleGetAccessPackageCatalogRole => exampleGetAccessPackageCatalogRole.objectId),
    principalObjectId: example.then(example => example.objectId),
    catalogId: exampleAccessPackageCatalog.id,
});
Copy
import pulumi
import pulumi_azuread as azuread

example = azuread.get_user(user_principal_name="jdoe@example.com")
example_get_access_package_catalog_role = azuread.get_access_package_catalog_role(display_name="Catalog owner")
example_access_package_catalog = azuread.AccessPackageCatalog("example",
    display_name="example-access-package-catalog",
    description="Example access package catalog")
example_access_package_catalog_role_assignment = azuread.AccessPackageCatalogRoleAssignment("example",
    role_id=example_get_access_package_catalog_role.object_id,
    principal_object_id=example.object_id,
    catalog_id=example_access_package_catalog.id)
Copy
package main

import (
	"github.com/pulumi/pulumi-azuread/sdk/v6/go/azuread"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := azuread.LookupUser(ctx, &azuread.LookupUserArgs{
			UserPrincipalName: pulumi.StringRef("jdoe@example.com"),
		}, nil)
		if err != nil {
			return err
		}
		exampleGetAccessPackageCatalogRole, err := azuread.GetAccessPackageCatalogRole(ctx, &azuread.GetAccessPackageCatalogRoleArgs{
			DisplayName: pulumi.StringRef("Catalog owner"),
		}, nil)
		if err != nil {
			return err
		}
		exampleAccessPackageCatalog, err := azuread.NewAccessPackageCatalog(ctx, "example", &azuread.AccessPackageCatalogArgs{
			DisplayName: pulumi.String("example-access-package-catalog"),
			Description: pulumi.String("Example access package catalog"),
		})
		if err != nil {
			return err
		}
		_, err = azuread.NewAccessPackageCatalogRoleAssignment(ctx, "example", &azuread.AccessPackageCatalogRoleAssignmentArgs{
			RoleId:            pulumi.String(exampleGetAccessPackageCatalogRole.ObjectId),
			PrincipalObjectId: pulumi.String(example.ObjectId),
			CatalogId:         exampleAccessPackageCatalog.ID(),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureAD = Pulumi.AzureAD;

return await Deployment.RunAsync(() => 
{
    var example = AzureAD.GetUser.Invoke(new()
    {
        UserPrincipalName = "jdoe@example.com",
    });

    var exampleGetAccessPackageCatalogRole = AzureAD.GetAccessPackageCatalogRole.Invoke(new()
    {
        DisplayName = "Catalog owner",
    });

    var exampleAccessPackageCatalog = new AzureAD.AccessPackageCatalog("example", new()
    {
        DisplayName = "example-access-package-catalog",
        Description = "Example access package catalog",
    });

    var exampleAccessPackageCatalogRoleAssignment = new AzureAD.AccessPackageCatalogRoleAssignment("example", new()
    {
        RoleId = exampleGetAccessPackageCatalogRole.Apply(getAccessPackageCatalogRoleResult => getAccessPackageCatalogRoleResult.ObjectId),
        PrincipalObjectId = example.Apply(getUserResult => getUserResult.ObjectId),
        CatalogId = exampleAccessPackageCatalog.Id,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azuread.AzureadFunctions;
import com.pulumi.azuread.inputs.GetUserArgs;
import com.pulumi.azuread.inputs.GetAccessPackageCatalogRoleArgs;
import com.pulumi.azuread.AccessPackageCatalog;
import com.pulumi.azuread.AccessPackageCatalogArgs;
import com.pulumi.azuread.AccessPackageCatalogRoleAssignment;
import com.pulumi.azuread.AccessPackageCatalogRoleAssignmentArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var example = AzureadFunctions.getUser(GetUserArgs.builder()
            .userPrincipalName("jdoe@example.com")
            .build());

        final var exampleGetAccessPackageCatalogRole = AzureadFunctions.getAccessPackageCatalogRole(GetAccessPackageCatalogRoleArgs.builder()
            .displayName("Catalog owner")
            .build());

        var exampleAccessPackageCatalog = new AccessPackageCatalog("exampleAccessPackageCatalog", AccessPackageCatalogArgs.builder()
            .displayName("example-access-package-catalog")
            .description("Example access package catalog")
            .build());

        var exampleAccessPackageCatalogRoleAssignment = new AccessPackageCatalogRoleAssignment("exampleAccessPackageCatalogRoleAssignment", AccessPackageCatalogRoleAssignmentArgs.builder()
            .roleId(exampleGetAccessPackageCatalogRole.applyValue(getAccessPackageCatalogRoleResult -> getAccessPackageCatalogRoleResult.objectId()))
            .principalObjectId(example.applyValue(getUserResult -> getUserResult.objectId()))
            .catalogId(exampleAccessPackageCatalog.id())
            .build());

    }
}
Copy
resources:
  exampleAccessPackageCatalog:
    type: azuread:AccessPackageCatalog
    name: example
    properties:
      displayName: example-access-package-catalog
      description: Example access package catalog
  exampleAccessPackageCatalogRoleAssignment:
    type: azuread:AccessPackageCatalogRoleAssignment
    name: example
    properties:
      roleId: ${exampleGetAccessPackageCatalogRole.objectId}
      principalObjectId: ${example.objectId}
      catalogId: ${exampleAccessPackageCatalog.id}
variables:
  example:
    fn::invoke:
      function: azuread:getUser
      arguments:
        userPrincipalName: jdoe@example.com
  exampleGetAccessPackageCatalogRole:
    fn::invoke:
      function: azuread:getAccessPackageCatalogRole
      arguments:
        displayName: Catalog owner
Copy

Create AccessPackageCatalogRoleAssignment Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new AccessPackageCatalogRoleAssignment(name: string, args: AccessPackageCatalogRoleAssignmentArgs, opts?: CustomResourceOptions);
@overload
def AccessPackageCatalogRoleAssignment(resource_name: str,
                                       args: AccessPackageCatalogRoleAssignmentArgs,
                                       opts: Optional[ResourceOptions] = None)

@overload
def AccessPackageCatalogRoleAssignment(resource_name: str,
                                       opts: Optional[ResourceOptions] = None,
                                       catalog_id: Optional[str] = None,
                                       principal_object_id: Optional[str] = None,
                                       role_id: Optional[str] = None)
func NewAccessPackageCatalogRoleAssignment(ctx *Context, name string, args AccessPackageCatalogRoleAssignmentArgs, opts ...ResourceOption) (*AccessPackageCatalogRoleAssignment, error)
public AccessPackageCatalogRoleAssignment(string name, AccessPackageCatalogRoleAssignmentArgs args, CustomResourceOptions? opts = null)
public AccessPackageCatalogRoleAssignment(String name, AccessPackageCatalogRoleAssignmentArgs args)
public AccessPackageCatalogRoleAssignment(String name, AccessPackageCatalogRoleAssignmentArgs args, CustomResourceOptions options)
type: azuread:AccessPackageCatalogRoleAssignment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. AccessPackageCatalogRoleAssignmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. AccessPackageCatalogRoleAssignmentArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. AccessPackageCatalogRoleAssignmentArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. AccessPackageCatalogRoleAssignmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. AccessPackageCatalogRoleAssignmentArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var accessPackageCatalogRoleAssignmentResource = new AzureAD.AccessPackageCatalogRoleAssignment("accessPackageCatalogRoleAssignmentResource", new()
{
    CatalogId = "string",
    PrincipalObjectId = "string",
    RoleId = "string",
});
Copy
example, err := azuread.NewAccessPackageCatalogRoleAssignment(ctx, "accessPackageCatalogRoleAssignmentResource", &azuread.AccessPackageCatalogRoleAssignmentArgs{
	CatalogId:         pulumi.String("string"),
	PrincipalObjectId: pulumi.String("string"),
	RoleId:            pulumi.String("string"),
})
Copy
var accessPackageCatalogRoleAssignmentResource = new AccessPackageCatalogRoleAssignment("accessPackageCatalogRoleAssignmentResource", AccessPackageCatalogRoleAssignmentArgs.builder()
    .catalogId("string")
    .principalObjectId("string")
    .roleId("string")
    .build());
Copy
access_package_catalog_role_assignment_resource = azuread.AccessPackageCatalogRoleAssignment("accessPackageCatalogRoleAssignmentResource",
    catalog_id="string",
    principal_object_id="string",
    role_id="string")
Copy
const accessPackageCatalogRoleAssignmentResource = new azuread.AccessPackageCatalogRoleAssignment("accessPackageCatalogRoleAssignmentResource", {
    catalogId: "string",
    principalObjectId: "string",
    roleId: "string",
});
Copy
type: azuread:AccessPackageCatalogRoleAssignment
properties:
    catalogId: string
    principalObjectId: string
    roleId: string
Copy

AccessPackageCatalogRoleAssignment Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The AccessPackageCatalogRoleAssignment resource accepts the following input properties:

CatalogId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Catalog this role assignment will be scoped to. Changing this forces a new resource to be created.
PrincipalObjectId
This property is required.
Changes to this property will trigger replacement.
string
The object ID of the principal for you want to create a role assignment. Supported object types are Users, Groups or Service Principals. Changing this forces a new resource to be created.
RoleId
This property is required.
Changes to this property will trigger replacement.
string
The object ID of the catalog role you want to assign. Changing this forces a new resource to be created.
CatalogId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Catalog this role assignment will be scoped to. Changing this forces a new resource to be created.
PrincipalObjectId
This property is required.
Changes to this property will trigger replacement.
string
The object ID of the principal for you want to create a role assignment. Supported object types are Users, Groups or Service Principals. Changing this forces a new resource to be created.
RoleId
This property is required.
Changes to this property will trigger replacement.
string
The object ID of the catalog role you want to assign. Changing this forces a new resource to be created.
catalogId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the Catalog this role assignment will be scoped to. Changing this forces a new resource to be created.
principalObjectId
This property is required.
Changes to this property will trigger replacement.
String
The object ID of the principal for you want to create a role assignment. Supported object types are Users, Groups or Service Principals. Changing this forces a new resource to be created.
roleId
This property is required.
Changes to this property will trigger replacement.
String
The object ID of the catalog role you want to assign. Changing this forces a new resource to be created.
catalogId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the Catalog this role assignment will be scoped to. Changing this forces a new resource to be created.
principalObjectId
This property is required.
Changes to this property will trigger replacement.
string
The object ID of the principal for you want to create a role assignment. Supported object types are Users, Groups or Service Principals. Changing this forces a new resource to be created.
roleId
This property is required.
Changes to this property will trigger replacement.
string
The object ID of the catalog role you want to assign. Changing this forces a new resource to be created.
catalog_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the Catalog this role assignment will be scoped to. Changing this forces a new resource to be created.
principal_object_id
This property is required.
Changes to this property will trigger replacement.
str
The object ID of the principal for you want to create a role assignment. Supported object types are Users, Groups or Service Principals. Changing this forces a new resource to be created.
role_id
This property is required.
Changes to this property will trigger replacement.
str
The object ID of the catalog role you want to assign. Changing this forces a new resource to be created.
catalogId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the Catalog this role assignment will be scoped to. Changing this forces a new resource to be created.
principalObjectId
This property is required.
Changes to this property will trigger replacement.
String
The object ID of the principal for you want to create a role assignment. Supported object types are Users, Groups or Service Principals. Changing this forces a new resource to be created.
roleId
This property is required.
Changes to this property will trigger replacement.
String
The object ID of the catalog role you want to assign. Changing this forces a new resource to be created.

Outputs

All input properties are implicitly available as output properties. Additionally, the AccessPackageCatalogRoleAssignment resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing AccessPackageCatalogRoleAssignment Resource

Get an existing AccessPackageCatalogRoleAssignment resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: AccessPackageCatalogRoleAssignmentState, opts?: CustomResourceOptions): AccessPackageCatalogRoleAssignment
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        catalog_id: Optional[str] = None,
        principal_object_id: Optional[str] = None,
        role_id: Optional[str] = None) -> AccessPackageCatalogRoleAssignment
func GetAccessPackageCatalogRoleAssignment(ctx *Context, name string, id IDInput, state *AccessPackageCatalogRoleAssignmentState, opts ...ResourceOption) (*AccessPackageCatalogRoleAssignment, error)
public static AccessPackageCatalogRoleAssignment Get(string name, Input<string> id, AccessPackageCatalogRoleAssignmentState? state, CustomResourceOptions? opts = null)
public static AccessPackageCatalogRoleAssignment get(String name, Output<String> id, AccessPackageCatalogRoleAssignmentState state, CustomResourceOptions options)
resources:  _:    type: azuread:AccessPackageCatalogRoleAssignment    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
CatalogId Changes to this property will trigger replacement. string
The ID of the Catalog this role assignment will be scoped to. Changing this forces a new resource to be created.
PrincipalObjectId Changes to this property will trigger replacement. string
The object ID of the principal for you want to create a role assignment. Supported object types are Users, Groups or Service Principals. Changing this forces a new resource to be created.
RoleId Changes to this property will trigger replacement. string
The object ID of the catalog role you want to assign. Changing this forces a new resource to be created.
CatalogId Changes to this property will trigger replacement. string
The ID of the Catalog this role assignment will be scoped to. Changing this forces a new resource to be created.
PrincipalObjectId Changes to this property will trigger replacement. string
The object ID of the principal for you want to create a role assignment. Supported object types are Users, Groups or Service Principals. Changing this forces a new resource to be created.
RoleId Changes to this property will trigger replacement. string
The object ID of the catalog role you want to assign. Changing this forces a new resource to be created.
catalogId Changes to this property will trigger replacement. String
The ID of the Catalog this role assignment will be scoped to. Changing this forces a new resource to be created.
principalObjectId Changes to this property will trigger replacement. String
The object ID of the principal for you want to create a role assignment. Supported object types are Users, Groups or Service Principals. Changing this forces a new resource to be created.
roleId Changes to this property will trigger replacement. String
The object ID of the catalog role you want to assign. Changing this forces a new resource to be created.
catalogId Changes to this property will trigger replacement. string
The ID of the Catalog this role assignment will be scoped to. Changing this forces a new resource to be created.
principalObjectId Changes to this property will trigger replacement. string
The object ID of the principal for you want to create a role assignment. Supported object types are Users, Groups or Service Principals. Changing this forces a new resource to be created.
roleId Changes to this property will trigger replacement. string
The object ID of the catalog role you want to assign. Changing this forces a new resource to be created.
catalog_id Changes to this property will trigger replacement. str
The ID of the Catalog this role assignment will be scoped to. Changing this forces a new resource to be created.
principal_object_id Changes to this property will trigger replacement. str
The object ID of the principal for you want to create a role assignment. Supported object types are Users, Groups or Service Principals. Changing this forces a new resource to be created.
role_id Changes to this property will trigger replacement. str
The object ID of the catalog role you want to assign. Changing this forces a new resource to be created.
catalogId Changes to this property will trigger replacement. String
The ID of the Catalog this role assignment will be scoped to. Changing this forces a new resource to be created.
principalObjectId Changes to this property will trigger replacement. String
The object ID of the principal for you want to create a role assignment. Supported object types are Users, Groups or Service Principals. Changing this forces a new resource to be created.
roleId Changes to this property will trigger replacement. String
The object ID of the catalog role you want to assign. Changing this forces a new resource to be created.

Import

Catalog role assignments can be imported using the ID of the assignment, e.g.

$ pulumi import azuread:index/accessPackageCatalogRoleAssignment:AccessPackageCatalogRoleAssignment example 00000000-0000-0000-0000-000000000000
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Azure Active Directory (Azure AD) pulumi/pulumi-azuread
License
Apache-2.0
Notes
This Pulumi package is based on the azuread Terraform Provider.