azuread.getDirectoryRoleTemplates
Explore with Pulumi AI
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/v6/go/azuread"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
current, err := azuread.GetDirectoryRoleTemplates(ctx, map[string]interface{}{}, 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.
- Object
Ids List<string> - The object IDs of the role templates.
- Role
Templates List<Pulumi.Azure AD. Outputs. Get Directory Role Templates Role Template> - 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.
- Object
Ids []string - The object IDs of the role templates.
- Role
Templates []GetDirectory Role Templates Role Template - 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.
- object
Ids List<String> - The object IDs of the role templates.
- role
Templates List<GetDirectory Role Templates Role Template> - 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.
- object
Ids string[] - The object IDs of the role templates.
- role
Templates GetDirectory Role Templates Role Template[] - 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[GetDirectory Role Templates Role Template] - 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.
- object
Ids List<String> - The object IDs of the role templates.
- role
Templates 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.
- Display
Name string - The display name of the directory role template.
- Object
Id string - The object ID of the directory role template.
- Description string
- The description of the directory role template.
- Display
Name string - The display name of the directory role template.
- Object
Id string - The object ID of the directory role template.
- description String
- The description of the directory role template.
- display
Name String - The display name of the directory role template.
- object
Id String - The object ID of the directory role template.
- description string
- The description of the directory role template.
- display
Name string - The display name of the directory role template.
- object
Id 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.
- display
Name String - The display name of the directory role template.
- object
Id 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.