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,
});
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)
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
})
}
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,
});
});
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());
}
}
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
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 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.
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",
});
example, err := azuread.NewAccessPackageCatalogRoleAssignment(ctx, "accessPackageCatalogRoleAssignmentResource", &azuread.AccessPackageCatalogRoleAssignmentArgs{
CatalogId: pulumi.String("string"),
PrincipalObjectId: pulumi.String("string"),
RoleId: pulumi.String("string"),
})
var accessPackageCatalogRoleAssignmentResource = new AccessPackageCatalogRoleAssignment("accessPackageCatalogRoleAssignmentResource", AccessPackageCatalogRoleAssignmentArgs.builder()
.catalogId("string")
.principalObjectId("string")
.roleId("string")
.build());
access_package_catalog_role_assignment_resource = azuread.AccessPackageCatalogRoleAssignment("accessPackageCatalogRoleAssignmentResource",
catalog_id="string",
principal_object_id="string",
role_id="string")
const accessPackageCatalogRoleAssignmentResource = new azuread.AccessPackageCatalogRoleAssignment("accessPackageCatalogRoleAssignmentResource", {
catalogId: "string",
principalObjectId: "string",
roleId: "string",
});
type: azuread:AccessPackageCatalogRoleAssignment
properties:
catalogId: string
principalObjectId: string
roleId: string
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:
- Catalog
Id string - The ID of the Catalog this role assignment will be scoped to. Changing this forces a new resource to be created.
- Principal
Object stringId - 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 string - The object ID of the catalog role you want to assign. Changing this forces a new resource to be created.
- Catalog
Id string - The ID of the Catalog this role assignment will be scoped to. Changing this forces a new resource to be created.
- Principal
Object stringId - 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 string - The object ID of the catalog role you want to assign. Changing this forces a new resource to be created.
- catalog
Id String - The ID of the Catalog this role assignment will be scoped to. Changing this forces a new resource to be created.
- principal
Object StringId - 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 String - The object ID of the catalog role you want to assign. Changing this forces a new resource to be created.
- catalog
Id string - The ID of the Catalog this role assignment will be scoped to. Changing this forces a new resource to be created.
- principal
Object stringId - 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 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_ strid - 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.
- catalog
Id String - The ID of the Catalog this role assignment will be scoped to. Changing this forces a new resource to be created.
- principal
Object StringId - 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 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.
- Catalog
Id string - The ID of the Catalog this role assignment will be scoped to. Changing this forces a new resource to be created.
- Principal
Object stringId - 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 string - The object ID of the catalog role you want to assign. Changing this forces a new resource to be created.
- Catalog
Id string - The ID of the Catalog this role assignment will be scoped to. Changing this forces a new resource to be created.
- Principal
Object stringId - 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 string - The object ID of the catalog role you want to assign. Changing this forces a new resource to be created.
- catalog
Id String - The ID of the Catalog this role assignment will be scoped to. Changing this forces a new resource to be created.
- principal
Object StringId - 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 String - The object ID of the catalog role you want to assign. Changing this forces a new resource to be created.
- catalog
Id string - The ID of the Catalog this role assignment will be scoped to. Changing this forces a new resource to be created.
- principal
Object stringId - 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 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_ strid - 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.
- catalog
Id String - The ID of the Catalog this role assignment will be scoped to. Changing this forces a new resource to be created.
- principal
Object StringId - 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 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
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.