1. Packages
  2. Azure Active Directory (Azure AD)
  3. API Docs
  4. DirectoryRoleEligibilityScheduleRequest
Azure Active Directory (Azure AD) v6.0.1 published on Monday, Oct 14, 2024 by Pulumi

azuread.DirectoryRoleEligibilityScheduleRequest

Explore with Pulumi AI

azuread logo
Azure Active Directory (Azure AD) v6.0.1 published on Monday, Oct 14, 2024 by Pulumi

    Manages a single directory role eligibility schedule request within Azure Active Directory.

    API Permissions

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

    The calling principal requires one of the following application roles: RoleEligibilitySchedule.ReadWrite.Directory or RoleManagement.ReadWrite.Directory.

    The calling principal requires one of the following directory roles: Privileged Role 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 exampleDirectoryRole = new azuread.DirectoryRole("example", {displayName: "Application Administrator"});
    const exampleDirectoryRoleEligibilityScheduleRequest = new azuread.DirectoryRoleEligibilityScheduleRequest("example", {
        roleDefinitionId: exampleDirectoryRole.templateId,
        principalId: exampleAzureadUser.objectId,
        directoryScopeId: "/",
        justification: "Example",
    });
    
    import pulumi
    import pulumi_azuread as azuread
    
    example = azuread.get_user(user_principal_name="jdoe@example.com")
    example_directory_role = azuread.DirectoryRole("example", display_name="Application Administrator")
    example_directory_role_eligibility_schedule_request = azuread.DirectoryRoleEligibilityScheduleRequest("example",
        role_definition_id=example_directory_role.template_id,
        principal_id=example_azuread_user["objectId"],
        directory_scope_id="/",
        justification="Example")
    
    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 {
    		_, err := azuread.LookupUser(ctx, &azuread.LookupUserArgs{
    			UserPrincipalName: pulumi.StringRef("jdoe@example.com"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		exampleDirectoryRole, err := azuread.NewDirectoryRole(ctx, "example", &azuread.DirectoryRoleArgs{
    			DisplayName: pulumi.String("Application Administrator"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = azuread.NewDirectoryRoleEligibilityScheduleRequest(ctx, "example", &azuread.DirectoryRoleEligibilityScheduleRequestArgs{
    			RoleDefinitionId: exampleDirectoryRole.TemplateId,
    			PrincipalId:      pulumi.Any(exampleAzureadUser.ObjectId),
    			DirectoryScopeId: pulumi.String("/"),
    			Justification:    pulumi.String("Example"),
    		})
    		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 exampleDirectoryRole = new AzureAD.DirectoryRole("example", new()
        {
            DisplayName = "Application Administrator",
        });
    
        var exampleDirectoryRoleEligibilityScheduleRequest = new AzureAD.DirectoryRoleEligibilityScheduleRequest("example", new()
        {
            RoleDefinitionId = exampleDirectoryRole.TemplateId,
            PrincipalId = exampleAzureadUser.ObjectId,
            DirectoryScopeId = "/",
            Justification = "Example",
        });
    
    });
    
    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.DirectoryRole;
    import com.pulumi.azuread.DirectoryRoleArgs;
    import com.pulumi.azuread.DirectoryRoleEligibilityScheduleRequest;
    import com.pulumi.azuread.DirectoryRoleEligibilityScheduleRequestArgs;
    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());
    
            var exampleDirectoryRole = new DirectoryRole("exampleDirectoryRole", DirectoryRoleArgs.builder()
                .displayName("Application Administrator")
                .build());
    
            var exampleDirectoryRoleEligibilityScheduleRequest = new DirectoryRoleEligibilityScheduleRequest("exampleDirectoryRoleEligibilityScheduleRequest", DirectoryRoleEligibilityScheduleRequestArgs.builder()
                .roleDefinitionId(exampleDirectoryRole.templateId())
                .principalId(exampleAzureadUser.objectId())
                .directoryScopeId("/")
                .justification("Example")
                .build());
    
        }
    }
    
    resources:
      exampleDirectoryRole:
        type: azuread:DirectoryRole
        name: example
        properties:
          displayName: Application Administrator
      exampleDirectoryRoleEligibilityScheduleRequest:
        type: azuread:DirectoryRoleEligibilityScheduleRequest
        name: example
        properties:
          roleDefinitionId: ${exampleDirectoryRole.templateId}
          principalId: ${exampleAzureadUser.objectId}
          directoryScopeId: /
          justification: Example
    variables:
      example:
        fn::invoke:
          Function: azuread:getUser
          Arguments:
            userPrincipalName: jdoe@example.com
    

    Note the use of the template_id attribute when referencing built-in roles.

    Create DirectoryRoleEligibilityScheduleRequest Resource

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

    Constructor syntax

    new DirectoryRoleEligibilityScheduleRequest(name: string, args: DirectoryRoleEligibilityScheduleRequestArgs, opts?: CustomResourceOptions);
    @overload
    def DirectoryRoleEligibilityScheduleRequest(resource_name: str,
                                                args: DirectoryRoleEligibilityScheduleRequestArgs,
                                                opts: Optional[ResourceOptions] = None)
    
    @overload
    def DirectoryRoleEligibilityScheduleRequest(resource_name: str,
                                                opts: Optional[ResourceOptions] = None,
                                                directory_scope_id: Optional[str] = None,
                                                justification: Optional[str] = None,
                                                principal_id: Optional[str] = None,
                                                role_definition_id: Optional[str] = None)
    func NewDirectoryRoleEligibilityScheduleRequest(ctx *Context, name string, args DirectoryRoleEligibilityScheduleRequestArgs, opts ...ResourceOption) (*DirectoryRoleEligibilityScheduleRequest, error)
    public DirectoryRoleEligibilityScheduleRequest(string name, DirectoryRoleEligibilityScheduleRequestArgs args, CustomResourceOptions? opts = null)
    public DirectoryRoleEligibilityScheduleRequest(String name, DirectoryRoleEligibilityScheduleRequestArgs args)
    public DirectoryRoleEligibilityScheduleRequest(String name, DirectoryRoleEligibilityScheduleRequestArgs args, CustomResourceOptions options)
    
    type: azuread:DirectoryRoleEligibilityScheduleRequest
    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 DirectoryRoleEligibilityScheduleRequestArgs
    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 DirectoryRoleEligibilityScheduleRequestArgs
    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 DirectoryRoleEligibilityScheduleRequestArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DirectoryRoleEligibilityScheduleRequestArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DirectoryRoleEligibilityScheduleRequestArgs
    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 directoryRoleEligibilityScheduleRequestResource = new AzureAD.DirectoryRoleEligibilityScheduleRequest("directoryRoleEligibilityScheduleRequestResource", new()
    {
        DirectoryScopeId = "string",
        Justification = "string",
        PrincipalId = "string",
        RoleDefinitionId = "string",
    });
    
    example, err := azuread.NewDirectoryRoleEligibilityScheduleRequest(ctx, "directoryRoleEligibilityScheduleRequestResource", &azuread.DirectoryRoleEligibilityScheduleRequestArgs{
    	DirectoryScopeId: pulumi.String("string"),
    	Justification:    pulumi.String("string"),
    	PrincipalId:      pulumi.String("string"),
    	RoleDefinitionId: pulumi.String("string"),
    })
    
    var directoryRoleEligibilityScheduleRequestResource = new DirectoryRoleEligibilityScheduleRequest("directoryRoleEligibilityScheduleRequestResource", DirectoryRoleEligibilityScheduleRequestArgs.builder()
        .directoryScopeId("string")
        .justification("string")
        .principalId("string")
        .roleDefinitionId("string")
        .build());
    
    directory_role_eligibility_schedule_request_resource = azuread.DirectoryRoleEligibilityScheduleRequest("directoryRoleEligibilityScheduleRequestResource",
        directory_scope_id="string",
        justification="string",
        principal_id="string",
        role_definition_id="string")
    
    const directoryRoleEligibilityScheduleRequestResource = new azuread.DirectoryRoleEligibilityScheduleRequest("directoryRoleEligibilityScheduleRequestResource", {
        directoryScopeId: "string",
        justification: "string",
        principalId: "string",
        roleDefinitionId: "string",
    });
    
    type: azuread:DirectoryRoleEligibilityScheduleRequest
    properties:
        directoryScopeId: string
        justification: string
        principalId: string
        roleDefinitionId: string
    

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

    DirectoryScopeId string
    Identifier of the directory object representing the scope of the role eligibility. Changing this forces a new resource to be created.
    Justification string
    Justification for why the principal is granted the role eligibility. Changing this forces a new resource to be created.
    PrincipalId string
    The object ID of the principal to granted the role eligibility. Changing this forces a new resource to be created.
    RoleDefinitionId 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.
    DirectoryScopeId string
    Identifier of the directory object representing the scope of the role eligibility. Changing this forces a new resource to be created.
    Justification string
    Justification for why the principal is granted the role eligibility. Changing this forces a new resource to be created.
    PrincipalId string
    The object ID of the principal to granted the role eligibility. Changing this forces a new resource to be created.
    RoleDefinitionId 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.
    directoryScopeId String
    Identifier of the directory object representing the scope of the role eligibility. Changing this forces a new resource to be created.
    justification String
    Justification for why the principal is granted the role eligibility. Changing this forces a new resource to be created.
    principalId String
    The object ID of the principal to granted the role eligibility. Changing this forces a new resource to be created.
    roleDefinitionId 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.
    directoryScopeId string
    Identifier of the directory object representing the scope of the role eligibility. Changing this forces a new resource to be created.
    justification string
    Justification for why the principal is granted the role eligibility. Changing this forces a new resource to be created.
    principalId string
    The object ID of the principal to granted the role eligibility. Changing this forces a new resource to be created.
    roleDefinitionId 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.
    directory_scope_id str
    Identifier of the directory object representing the scope of the role eligibility. Changing this forces a new resource to be created.
    justification str
    Justification for why the principal is granted the role eligibility. Changing this forces a new resource to be created.
    principal_id str
    The object ID of the principal to granted the role eligibility. Changing this forces a new resource to be created.
    role_definition_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.
    directoryScopeId String
    Identifier of the directory object representing the scope of the role eligibility. Changing this forces a new resource to be created.
    justification String
    Justification for why the principal is granted the role eligibility. Changing this forces a new resource to be created.
    principalId String
    The object ID of the principal to granted the role eligibility. Changing this forces a new resource to be created.
    roleDefinitionId 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.

    Outputs

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

    Get an existing DirectoryRoleEligibilityScheduleRequest 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?: DirectoryRoleEligibilityScheduleRequestState, opts?: CustomResourceOptions): DirectoryRoleEligibilityScheduleRequest
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            directory_scope_id: Optional[str] = None,
            justification: Optional[str] = None,
            principal_id: Optional[str] = None,
            role_definition_id: Optional[str] = None) -> DirectoryRoleEligibilityScheduleRequest
    func GetDirectoryRoleEligibilityScheduleRequest(ctx *Context, name string, id IDInput, state *DirectoryRoleEligibilityScheduleRequestState, opts ...ResourceOption) (*DirectoryRoleEligibilityScheduleRequest, error)
    public static DirectoryRoleEligibilityScheduleRequest Get(string name, Input<string> id, DirectoryRoleEligibilityScheduleRequestState? state, CustomResourceOptions? opts = null)
    public static DirectoryRoleEligibilityScheduleRequest get(String name, Output<String> id, DirectoryRoleEligibilityScheduleRequestState 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:
    DirectoryScopeId string
    Identifier of the directory object representing the scope of the role eligibility. Changing this forces a new resource to be created.
    Justification string
    Justification for why the principal is granted the role eligibility. Changing this forces a new resource to be created.
    PrincipalId string
    The object ID of the principal to granted the role eligibility. Changing this forces a new resource to be created.
    RoleDefinitionId 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.
    DirectoryScopeId string
    Identifier of the directory object representing the scope of the role eligibility. Changing this forces a new resource to be created.
    Justification string
    Justification for why the principal is granted the role eligibility. Changing this forces a new resource to be created.
    PrincipalId string
    The object ID of the principal to granted the role eligibility. Changing this forces a new resource to be created.
    RoleDefinitionId 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.
    directoryScopeId String
    Identifier of the directory object representing the scope of the role eligibility. Changing this forces a new resource to be created.
    justification String
    Justification for why the principal is granted the role eligibility. Changing this forces a new resource to be created.
    principalId String
    The object ID of the principal to granted the role eligibility. Changing this forces a new resource to be created.
    roleDefinitionId 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.
    directoryScopeId string
    Identifier of the directory object representing the scope of the role eligibility. Changing this forces a new resource to be created.
    justification string
    Justification for why the principal is granted the role eligibility. Changing this forces a new resource to be created.
    principalId string
    The object ID of the principal to granted the role eligibility. Changing this forces a new resource to be created.
    roleDefinitionId 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.
    directory_scope_id str
    Identifier of the directory object representing the scope of the role eligibility. Changing this forces a new resource to be created.
    justification str
    Justification for why the principal is granted the role eligibility. Changing this forces a new resource to be created.
    principal_id str
    The object ID of the principal to granted the role eligibility. Changing this forces a new resource to be created.
    role_definition_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.
    directoryScopeId String
    Identifier of the directory object representing the scope of the role eligibility. Changing this forces a new resource to be created.
    justification String
    Justification for why the principal is granted the role eligibility. Changing this forces a new resource to be created.
    principalId String
    The object ID of the principal to granted the role eligibility. Changing this forces a new resource to be created.
    roleDefinitionId 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 eligibility schedule requests can be imported using the ID of the assignment, e.g.

    $ pulumi import azuread:index/directoryRoleEligibilityScheduleRequest:DirectoryRoleEligibilityScheduleRequest example 822ec710-4c9f-4f71-a27a-451759cc7522
    

    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.
    azuread logo
    Azure Active Directory (Azure AD) v6.0.1 published on Monday, Oct 14, 2024 by Pulumi