1. Packages
  2. Azure Active Directory (Azure AD)
  3. API Docs
  4. getDirectoryRoleTemplates
Azure Active Directory (Azure AD) v5.48.0 published on Monday, Apr 15, 2024 by Pulumi

azuread.getDirectoryRoleTemplates

Explore with Pulumi AI

azuread logo
Azure Active Directory (Azure AD) v5.48.0 published on Monday, Apr 15, 2024 by Pulumi

    Use this data source to access information about directory role templates 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.Read.Directory or Directory.Read.All

    When authenticated with a user principal, this data source does not require any additional roles.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azuread from "@pulumi/azuread";
    
    const current = azuread.getDirectoryRoleTemplates({});
    export const roles = current.then(current => current.objectIds);
    
    import pulumi
    import pulumi_azuread as azuread
    
    current = azuread.get_directory_role_templates()
    pulumi.export("roles", current.object_ids)
    
    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 {
    		current, err := azuread.GetDirectoryRoleTemplates(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("roles", current.ObjectIds)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureAD = Pulumi.AzureAD;
    
    return await Deployment.RunAsync(() => 
    {
        var current = AzureAD.GetDirectoryRoleTemplates.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["roles"] = current.Apply(getDirectoryRoleTemplatesResult => getDirectoryRoleTemplatesResult.ObjectIds),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azuread.AzureadFunctions;
    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 current = AzureadFunctions.getDirectoryRoleTemplates();
    
            ctx.export("roles", current.applyValue(getDirectoryRoleTemplatesResult -> getDirectoryRoleTemplatesResult.objectIds()));
        }
    }
    
    variables:
      current:
        fn::invoke:
          Function: azuread:getDirectoryRoleTemplates
          Arguments: {}
    outputs:
      roles: ${current.objectIds}
    

    Using getDirectoryRoleTemplates

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getDirectoryRoleTemplates(opts?: InvokeOptions): Promise<GetDirectoryRoleTemplatesResult>
    function getDirectoryRoleTemplatesOutput(opts?: InvokeOptions): Output<GetDirectoryRoleTemplatesResult>
    def get_directory_role_templates(opts: Optional[InvokeOptions] = None) -> GetDirectoryRoleTemplatesResult
    def get_directory_role_templates_output(opts: Optional[InvokeOptions] = None) -> Output[GetDirectoryRoleTemplatesResult]
    func GetDirectoryRoleTemplates(ctx *Context, opts ...InvokeOption) (*GetDirectoryRoleTemplatesResult, error)
    func GetDirectoryRoleTemplatesOutput(ctx *Context, opts ...InvokeOption) GetDirectoryRoleTemplatesResultOutput

    > Note: This function is named GetDirectoryRoleTemplates in the Go SDK.

    public static class GetDirectoryRoleTemplates 
    {
        public static Task<GetDirectoryRoleTemplatesResult> InvokeAsync(InvokeOptions? opts = null)
        public static Output<GetDirectoryRoleTemplatesResult> Invoke(InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetDirectoryRoleTemplatesResult> getDirectoryRoleTemplates(InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: azuread:index/getDirectoryRoleTemplates:getDirectoryRoleTemplates
      arguments:
        # arguments dictionary

    getDirectoryRoleTemplates Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    ObjectIds List<string>
    The object IDs of the role templates.
    RoleTemplates List<Pulumi.AzureAD.Outputs.GetDirectoryRoleTemplatesRoleTemplate>
    A list of role templates. Each role_template object provides the attributes documented below.
    Id string
    The provider-assigned unique ID for this managed resource.
    ObjectIds []string
    The object IDs of the role templates.
    RoleTemplates []GetDirectoryRoleTemplatesRoleTemplate
    A list of role templates. Each role_template object provides the attributes documented below.
    id String
    The provider-assigned unique ID for this managed resource.
    objectIds List<String>
    The object IDs of the role templates.
    roleTemplates List<GetDirectoryRoleTemplatesRoleTemplate>
    A list of role templates. Each role_template object provides the attributes documented below.
    id string
    The provider-assigned unique ID for this managed resource.
    objectIds string[]
    The object IDs of the role templates.
    roleTemplates GetDirectoryRoleTemplatesRoleTemplate[]
    A list of role templates. Each role_template object provides the attributes documented below.
    id str
    The provider-assigned unique ID for this managed resource.
    object_ids Sequence[str]
    The object IDs of the role templates.
    role_templates Sequence[GetDirectoryRoleTemplatesRoleTemplate]
    A list of role templates. Each role_template object provides the attributes documented below.
    id String
    The provider-assigned unique ID for this managed resource.
    objectIds List<String>
    The object IDs of the role templates.
    roleTemplates List<Property Map>
    A list of role templates. Each role_template object provides the attributes documented below.

    Supporting Types

    GetDirectoryRoleTemplatesRoleTemplate

    Description string
    The description of the directory role template.
    DisplayName string
    The display name of the directory role template.
    ObjectId string
    The object ID of the directory role template.
    Description string
    The description of the directory role template.
    DisplayName string
    The display name of the directory role template.
    ObjectId string
    The object ID of the directory role template.
    description String
    The description of the directory role template.
    displayName String
    The display name of the directory role template.
    objectId String
    The object ID of the directory role template.
    description string
    The description of the directory role template.
    displayName string
    The display name of the directory role template.
    objectId string
    The object ID of the directory role template.
    description str
    The description of the directory role template.
    display_name str
    The display name of the directory role template.
    object_id str
    The object ID of the directory role template.
    description String
    The description of the directory role template.
    displayName String
    The display name of the directory role template.
    objectId String
    The object ID of the directory role template.

    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) v5.48.0 published on Monday, Apr 15, 2024 by Pulumi