Azure Active Directory (Azure AD) v5.38.0, May 17 23
Azure Active Directory (Azure AD) v5.38.0, May 17 23
azuread.DirectoryRoleAssignment
Explore with Pulumi AI
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 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:
- 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 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 stringId 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 stringObject Id Identifier of the app-specific scope when the assignment scope is app-specific
app_scope_object_id
has been renamed toapp_scope_id
and will be removed in version 3.0 or the AzureAD Provider- Directory
Scope stringId 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 stringObject Id Identifier of the directory object representing the scope of the assignment
- 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 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 stringId 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 stringObject Id Identifier of the app-specific scope when the assignment scope is app-specific
app_scope_object_id
has been renamed toapp_scope_id
and will be removed in version 3.0 or the AzureAD Provider- Directory
Scope stringId 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 stringObject Id Identifier of the directory object representing the scope of the assignment
- 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 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 StringId 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 StringObject Id Identifier of the app-specific scope when the assignment scope is app-specific
app_scope_object_id
has been renamed toapp_scope_id
and will be removed in version 3.0 or the AzureAD Provider- directory
Scope StringId 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 StringObject Id Identifier of the directory object representing the scope of the assignment
- 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 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 stringId 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 stringObject Id Identifier of the app-specific scope when the assignment scope is app-specific
app_scope_object_id
has been renamed toapp_scope_id
and will be removed in version 3.0 or the AzureAD Provider- directory
Scope stringId 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 stringObject Id Identifier of the directory object representing the scope of the assignment
- 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 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_ strid 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_ strobject_ id Identifier of the app-specific scope when the assignment scope is app-specific
app_scope_object_id
has been renamed toapp_scope_id
and will be removed in version 3.0 or the AzureAD Provider- directory_
scope_ strid 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_ strobject_ id Identifier of the directory object representing the scope of the assignment
- 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 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 StringId 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 StringObject Id Identifier of the app-specific scope when the assignment scope is app-specific
app_scope_object_id
has been renamed toapp_scope_id
and will be removed in version 3.0 or the AzureAD Provider- directory
Scope StringId 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 StringObject Id 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 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.
- App
Scope stringId 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 stringObject Id Identifier of the app-specific scope when the assignment scope is app-specific
app_scope_object_id
has been renamed toapp_scope_id
and will be removed in version 3.0 or the AzureAD Provider- Directory
Scope stringId 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 stringObject Id Identifier of the directory object representing the scope of the assignment
- 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 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 stringId 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 stringObject Id Identifier of the app-specific scope when the assignment scope is app-specific
app_scope_object_id
has been renamed toapp_scope_id
and will be removed in version 3.0 or the AzureAD Provider- Directory
Scope stringId 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 stringObject Id Identifier of the directory object representing the scope of the assignment
- 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 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 StringId 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 StringObject Id Identifier of the app-specific scope when the assignment scope is app-specific
app_scope_object_id
has been renamed toapp_scope_id
and will be removed in version 3.0 or the AzureAD Provider- directory
Scope StringId 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 StringObject Id Identifier of the directory object representing the scope of the assignment
- 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 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 stringId 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 stringObject Id Identifier of the app-specific scope when the assignment scope is app-specific
app_scope_object_id
has been renamed toapp_scope_id
and will be removed in version 3.0 or the AzureAD Provider- directory
Scope stringId 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 stringObject Id Identifier of the directory object representing the scope of the assignment
- 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 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_ strid 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_ strobject_ id Identifier of the app-specific scope when the assignment scope is app-specific
app_scope_object_id
has been renamed toapp_scope_id
and will be removed in version 3.0 or the AzureAD Provider- directory_
scope_ strid 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_ strobject_ id Identifier of the directory object representing the scope of the assignment
- 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 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 StringId 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 StringObject Id Identifier of the app-specific scope when the assignment scope is app-specific
app_scope_object_id
has been renamed toapp_scope_id
and will be removed in version 3.0 or the AzureAD Provider- directory
Scope StringId 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 StringObject Id Identifier of the directory object representing the scope of the assignment
- 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 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
- Azure Active Directory (Azure AD) pulumi/pulumi-azuread
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
azuread
Terraform Provider.