azuread logo
Azure Active Directory (Azure AD) v5.38.0, May 17 23

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

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureAD = Pulumi.AzureAD;

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

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

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

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

});
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleUser, err := azuread.LookupUser(ctx, &azuread.LookupUserArgs{
			UserPrincipalName: pulumi.StringRef("jdoe@hashicorp.com"),
		}, nil)
		if err != nil {
			return err
		}
		exampleAccessPackageCatalogRole, err := azuread.GetAccessPackageCatalogRole(ctx, &azuread.GetAccessPackageCatalogRoleArgs{
			DisplayName: pulumi.StringRef("Catalog owner"),
		}, nil)
		if err != nil {
			return err
		}
		exampleAccessPackageCatalog, err := azuread.NewAccessPackageCatalog(ctx, "exampleAccessPackageCatalog", &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, "exampleAccessPackageCatalogRoleAssignment", &azuread.AccessPackageCatalogRoleAssignmentArgs{
			RoleId:            *pulumi.String(exampleAccessPackageCatalogRole.ObjectId),
			PrincipalObjectId: *pulumi.String(exampleUser.ObjectId),
			CatalogId:         exampleAccessPackageCatalog.ID(),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
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 exampleUser = AzureadFunctions.getUser(GetUserArgs.builder()
            .userPrincipalName("jdoe@hashicorp.com")
            .build());

        final var exampleAccessPackageCatalogRole = 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(exampleAccessPackageCatalogRole.applyValue(getAccessPackageCatalogRoleResult -> getAccessPackageCatalogRoleResult.objectId()))
            .principalObjectId(exampleUser.applyValue(getUserResult -> getUserResult.objectId()))
            .catalogId(exampleAccessPackageCatalog.id())
            .build());

    }
}
import pulumi
import pulumi_azuread as azuread

example_user = azuread.get_user(user_principal_name="jdoe@hashicorp.com")
example_access_package_catalog_role = azuread.get_access_package_catalog_role(display_name="Catalog owner")
example_access_package_catalog = azuread.AccessPackageCatalog("exampleAccessPackageCatalog",
    display_name="example-access-package-catalog",
    description="Example access package catalog")
example_access_package_catalog_role_assignment = azuread.AccessPackageCatalogRoleAssignment("exampleAccessPackageCatalogRoleAssignment",
    role_id=example_access_package_catalog_role.object_id,
    principal_object_id=example_user.object_id,
    catalog_id=example_access_package_catalog.id)
import * as pulumi from "@pulumi/pulumi";
import * as azuread from "@pulumi/azuread";

const exampleUser = azuread.getUser({
    userPrincipalName: "jdoe@hashicorp.com",
});
const exampleAccessPackageCatalogRole = azuread.getAccessPackageCatalogRole({
    displayName: "Catalog owner",
});
const exampleAccessPackageCatalog = new azuread.AccessPackageCatalog("exampleAccessPackageCatalog", {
    displayName: "example-access-package-catalog",
    description: "Example access package catalog",
});
const exampleAccessPackageCatalogRoleAssignment = new azuread.AccessPackageCatalogRoleAssignment("exampleAccessPackageCatalogRoleAssignment", {
    roleId: exampleAccessPackageCatalogRole.then(exampleAccessPackageCatalogRole => exampleAccessPackageCatalogRole.objectId),
    principalObjectId: exampleUser.then(exampleUser => exampleUser.objectId),
    catalogId: exampleAccessPackageCatalog.id,
});
resources:
  exampleAccessPackageCatalog:
    type: azuread:AccessPackageCatalog
    properties:
      displayName: example-access-package-catalog
      description: Example access package catalog
  exampleAccessPackageCatalogRoleAssignment:
    type: azuread:AccessPackageCatalogRoleAssignment
    properties:
      roleId: ${exampleAccessPackageCatalogRole.objectId}
      principalObjectId: ${exampleUser.objectId}
      catalogId: ${exampleAccessPackageCatalog.id}
variables:
  exampleUser:
    fn::invoke:
      Function: azuread:getUser
      Arguments:
        userPrincipalName: jdoe@hashicorp.com
  exampleAccessPackageCatalogRole:
    fn::invoke:
      Function: azuread:getAccessPackageCatalogRole
      Arguments:
        displayName: Catalog owner

Create AccessPackageCatalogRoleAssignment Resource

new AccessPackageCatalogRoleAssignment(name: string, args: AccessPackageCatalogRoleAssignmentArgs, opts?: CustomResourceOptions);
@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)
@overload
def AccessPackageCatalogRoleAssignment(resource_name: str,
                                       args: AccessPackageCatalogRoleAssignmentArgs,
                                       opts: Optional[ResourceOptions] = 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.

name string
The unique name of the resource.
args AccessPackageCatalogRoleAssignmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args 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 string
The unique name of the resource.
args AccessPackageCatalogRoleAssignmentArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args AccessPackageCatalogRoleAssignmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args AccessPackageCatalogRoleAssignmentArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

The AccessPackageCatalogRoleAssignment resource accepts the following input properties:

CatalogId string

The ID of the Catalog this role assignment will be scoped to. Changing this forces a new resource to be created.

PrincipalObjectId 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 string

The object ID of the catalog role you want to assign. Changing this forces a new resource to be created.

CatalogId string

The ID of the Catalog this role assignment will be scoped to. Changing this forces a new resource to be created.

PrincipalObjectId 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 string

The object ID of the catalog role you want to assign. Changing this forces a new resource to be created.

catalogId String

The ID of the Catalog this role assignment will be scoped to. Changing this forces a new resource to be created.

principalObjectId 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 String

The object ID of the catalog role you want to assign. Changing this forces a new resource to be created.

catalogId string

The ID of the Catalog this role assignment will be scoped to. Changing this forces a new resource to be created.

principalObjectId 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 string

The object ID of the catalog role you want to assign. Changing this forces a new resource to be created.

catalog_id 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 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 str

The object ID of the catalog role you want to assign. Changing this forces a new resource to be created.

catalogId String

The ID of the Catalog this role assignment will be scoped to. Changing this forces a new resource to be created.

principalObjectId 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 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)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
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
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
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
The unique name of the resulting resource.
id
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
The unique name of the resulting resource.
id
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 string

The ID of the Catalog this role assignment will be scoped to. Changing this forces a new resource to be created.

PrincipalObjectId 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 string

The object ID of the catalog role you want to assign. Changing this forces a new resource to be created.

CatalogId string

The ID of the Catalog this role assignment will be scoped to. Changing this forces a new resource to be created.

PrincipalObjectId 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 string

The object ID of the catalog role you want to assign. Changing this forces a new resource to be created.

catalogId String

The ID of the Catalog this role assignment will be scoped to. Changing this forces a new resource to be created.

principalObjectId 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 String

The object ID of the catalog role you want to assign. Changing this forces a new resource to be created.

catalogId string

The ID of the Catalog this role assignment will be scoped to. Changing this forces a new resource to be created.

principalObjectId 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 string

The object ID of the catalog role you want to assign. Changing this forces a new resource to be created.

catalog_id 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 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 str

The object ID of the catalog role you want to assign. Changing this forces a new resource to be created.

catalogId String

The ID of the Catalog this role assignment will be scoped to. Changing this forces a new resource to be created.

principalObjectId 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 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 test 00000000-0000-0000-0000-000000000000

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.