AzureAD

Pulumi Official
Package maintained by Pulumi
v5.26.1 published on Monday, Jul 11, 2022 by Pulumi

DirectoryRoleAssignment

Manages a single directory 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: RoleManagement.ReadWrite.Directory or Directory.ReadWrite.All

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

Create a DirectoryRoleAssignment Resource

new DirectoryRoleAssignment(name: string, args: DirectoryRoleAssignmentArgs, opts?: CustomResourceOptions);
@overload
def DirectoryRoleAssignment(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            app_scope_id: Optional[str] = None,
                            app_scope_object_id: Optional[str] = None,
                            directory_scope_id: Optional[str] = None,
                            directory_scope_object_id: Optional[str] = None,
                            principal_object_id: Optional[str] = None,
                            role_id: Optional[str] = None)
@overload
def DirectoryRoleAssignment(resource_name: str,
                            args: DirectoryRoleAssignmentArgs,
                            opts: Optional[ResourceOptions] = None)
func NewDirectoryRoleAssignment(ctx *Context, name string, args DirectoryRoleAssignmentArgs, opts ...ResourceOption) (*DirectoryRoleAssignment, error)
public DirectoryRoleAssignment(string name, DirectoryRoleAssignmentArgs args, CustomResourceOptions? opts = null)
public DirectoryRoleAssignment(String name, DirectoryRoleAssignmentArgs args)
public DirectoryRoleAssignment(String name, DirectoryRoleAssignmentArgs args, CustomResourceOptions options)
type: azuread:DirectoryRoleAssignment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

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

DirectoryRoleAssignment 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 DirectoryRoleAssignment resource accepts the following input properties:

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 template ID (in the case of built-in roles) or object ID (in the case of custom roles) of the directory role you want to assign. Changing this forces a new resource to be created.

AppScopeId string

Identifier of the app-specific scope when the assignment scope is app-specific. Cannot be used with directory_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.

AppScopeObjectId string

Identifier of the app-specific scope when the assignment scope is app-specific

Deprecated:

app_scope_object_id has been renamed to app_scope_id and will be removed in version 3.0 or the AzureAD Provider

DirectoryScopeId string

Identifier of the directory object representing the scope of the assignment. Cannot be used with app_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.

DirectoryScopeObjectId string

Identifier of the directory object representing the scope of the assignment

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 template ID (in the case of built-in roles) or object ID (in the case of custom roles) of the directory role you want to assign. Changing this forces a new resource to be created.

AppScopeId string

Identifier of the app-specific scope when the assignment scope is app-specific. Cannot be used with directory_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.

AppScopeObjectId string

Identifier of the app-specific scope when the assignment scope is app-specific

Deprecated:

app_scope_object_id has been renamed to app_scope_id and will be removed in version 3.0 or the AzureAD Provider

DirectoryScopeId string

Identifier of the directory object representing the scope of the assignment. Cannot be used with app_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.

DirectoryScopeObjectId string

Identifier of the directory object representing the scope of the assignment

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 template ID (in the case of built-in roles) or object ID (in the case of custom roles) of the directory role you want to assign. Changing this forces a new resource to be created.

appScopeId String

Identifier of the app-specific scope when the assignment scope is app-specific. Cannot be used with directory_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.

appScopeObjectId String

Identifier of the app-specific scope when the assignment scope is app-specific

Deprecated:

app_scope_object_id has been renamed to app_scope_id and will be removed in version 3.0 or the AzureAD Provider

directoryScopeId String

Identifier of the directory object representing the scope of the assignment. Cannot be used with app_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.

directoryScopeObjectId String

Identifier of the directory object representing the scope of the assignment

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 template ID (in the case of built-in roles) or object ID (in the case of custom roles) of the directory role you want to assign. Changing this forces a new resource to be created.

appScopeId string

Identifier of the app-specific scope when the assignment scope is app-specific. Cannot be used with directory_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.

appScopeObjectId string

Identifier of the app-specific scope when the assignment scope is app-specific

Deprecated:

app_scope_object_id has been renamed to app_scope_id and will be removed in version 3.0 or the AzureAD Provider

directoryScopeId string

Identifier of the directory object representing the scope of the assignment. Cannot be used with app_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.

directoryScopeObjectId string

Identifier of the directory object representing the scope of the assignment

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 template ID (in the case of built-in roles) or object ID (in the case of custom roles) of the directory role you want to assign. Changing this forces a new resource to be created.

app_scope_id str

Identifier of the app-specific scope when the assignment scope is app-specific. Cannot be used with directory_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.

app_scope_object_id str

Identifier of the app-specific scope when the assignment scope is app-specific

Deprecated:

app_scope_object_id has been renamed to app_scope_id and will be removed in version 3.0 or the AzureAD Provider

directory_scope_id str

Identifier of the directory object representing the scope of the assignment. Cannot be used with app_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.

directory_scope_object_id str

Identifier of the directory object representing the scope of the assignment

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 template ID (in the case of built-in roles) or object ID (in the case of custom roles) of the directory role you want to assign. Changing this forces a new resource to be created.

appScopeId String

Identifier of the app-specific scope when the assignment scope is app-specific. Cannot be used with directory_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.

appScopeObjectId String

Identifier of the app-specific scope when the assignment scope is app-specific

Deprecated:

app_scope_object_id has been renamed to app_scope_id and will be removed in version 3.0 or the AzureAD Provider

directoryScopeId String

Identifier of the directory object representing the scope of the assignment. Cannot be used with app_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.

directoryScopeObjectId String

Identifier of the directory object representing the scope of the assignment

Outputs

All input properties are implicitly available as output properties. Additionally, the DirectoryRoleAssignment 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 an Existing DirectoryRoleAssignment Resource

Get an existing DirectoryRoleAssignment 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?: DirectoryRoleAssignmentState, opts?: CustomResourceOptions): DirectoryRoleAssignment
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        app_scope_id: Optional[str] = None,
        app_scope_object_id: Optional[str] = None,
        directory_scope_id: Optional[str] = None,
        directory_scope_object_id: Optional[str] = None,
        principal_object_id: Optional[str] = None,
        role_id: Optional[str] = None) -> DirectoryRoleAssignment
func GetDirectoryRoleAssignment(ctx *Context, name string, id IDInput, state *DirectoryRoleAssignmentState, opts ...ResourceOption) (*DirectoryRoleAssignment, error)
public static DirectoryRoleAssignment Get(string name, Input<string> id, DirectoryRoleAssignmentState? state, CustomResourceOptions? opts = null)
public static DirectoryRoleAssignment get(String name, Output<String> id, DirectoryRoleAssignmentState 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:
AppScopeId string

Identifier of the app-specific scope when the assignment scope is app-specific. Cannot be used with directory_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.

AppScopeObjectId string

Identifier of the app-specific scope when the assignment scope is app-specific

Deprecated:

app_scope_object_id has been renamed to app_scope_id and will be removed in version 3.0 or the AzureAD Provider

DirectoryScopeId string

Identifier of the directory object representing the scope of the assignment. Cannot be used with app_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.

DirectoryScopeObjectId string

Identifier of the directory object representing the scope of the assignment

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 template ID (in the case of built-in roles) or object ID (in the case of custom roles) of the directory role you want to assign. Changing this forces a new resource to be created.

AppScopeId string

Identifier of the app-specific scope when the assignment scope is app-specific. Cannot be used with directory_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.

AppScopeObjectId string

Identifier of the app-specific scope when the assignment scope is app-specific

Deprecated:

app_scope_object_id has been renamed to app_scope_id and will be removed in version 3.0 or the AzureAD Provider

DirectoryScopeId string

Identifier of the directory object representing the scope of the assignment. Cannot be used with app_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.

DirectoryScopeObjectId string

Identifier of the directory object representing the scope of the assignment

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 template ID (in the case of built-in roles) or object ID (in the case of custom roles) of the directory role you want to assign. Changing this forces a new resource to be created.

appScopeId String

Identifier of the app-specific scope when the assignment scope is app-specific. Cannot be used with directory_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.

appScopeObjectId String

Identifier of the app-specific scope when the assignment scope is app-specific

Deprecated:

app_scope_object_id has been renamed to app_scope_id and will be removed in version 3.0 or the AzureAD Provider

directoryScopeId String

Identifier of the directory object representing the scope of the assignment. Cannot be used with app_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.

directoryScopeObjectId String

Identifier of the directory object representing the scope of the assignment

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 template ID (in the case of built-in roles) or object ID (in the case of custom roles) of the directory role you want to assign. Changing this forces a new resource to be created.

appScopeId string

Identifier of the app-specific scope when the assignment scope is app-specific. Cannot be used with directory_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.

appScopeObjectId string

Identifier of the app-specific scope when the assignment scope is app-specific

Deprecated:

app_scope_object_id has been renamed to app_scope_id and will be removed in version 3.0 or the AzureAD Provider

directoryScopeId string

Identifier of the directory object representing the scope of the assignment. Cannot be used with app_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.

directoryScopeObjectId string

Identifier of the directory object representing the scope of the assignment

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 template ID (in the case of built-in roles) or object ID (in the case of custom roles) of the directory role you want to assign. Changing this forces a new resource to be created.

app_scope_id str

Identifier of the app-specific scope when the assignment scope is app-specific. Cannot be used with directory_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.

app_scope_object_id str

Identifier of the app-specific scope when the assignment scope is app-specific

Deprecated:

app_scope_object_id has been renamed to app_scope_id and will be removed in version 3.0 or the AzureAD Provider

directory_scope_id str

Identifier of the directory object representing the scope of the assignment. Cannot be used with app_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.

directory_scope_object_id str

Identifier of the directory object representing the scope of the assignment

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 template ID (in the case of built-in roles) or object ID (in the case of custom roles) of the directory role you want to assign. Changing this forces a new resource to be created.

appScopeId String

Identifier of the app-specific scope when the assignment scope is app-specific. Cannot be used with directory_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.

appScopeObjectId String

Identifier of the app-specific scope when the assignment scope is app-specific

Deprecated:

app_scope_object_id has been renamed to app_scope_id and will be removed in version 3.0 or the AzureAD Provider

directoryScopeId String

Identifier of the directory object representing the scope of the assignment. Cannot be used with app_scope_id. See official documentation for example usage. Changing this forces a new resource to be created.

directoryScopeObjectId String

Identifier of the directory object representing the scope of the assignment

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 template ID (in the case of built-in roles) or object ID (in the case of custom roles) of the directory role you want to assign. Changing this forces a new resource to be created.

Import

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

 $ pulumi import azuread:index/directoryRoleAssignment:DirectoryRoleAssignment test ePROZI_iKE653D_d6aoLHyr-lKgHI8ZGiIdz8CLVcng-1

Package Details

Repository
https://github.com/pulumi/pulumi-azuread
License
Apache-2.0
Notes

This Pulumi package is based on the azuread Terraform Provider.