import * as pulumi from "@pulumi/pulumi"; import * as outputs from "../types/output"; /** * Use this data source to access information about an existing Role Definition. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azure from "@pulumi/azure"; * * const primary = azure.core.getSubscription({}); * const customRoleDefinition = new azure.authorization.RoleDefinition("custom", { * roleDefinitionId: "00000000-0000-0000-0000-000000000000", * name: "CustomRoleDef", * scope: primary.then(primary => primary.id), * }); * const custom = pulumi.all([customRoleDefinition.roleDefinitionId, primary]).apply(([roleDefinitionId, primary]) => azure.authorization.getRoleDefinitionOutput({ * roleDefinitionId: roleDefinitionId, * scope: primary.id, * })); * const custom_byname = pulumi.all([customRoleDefinition.name, primary]).apply(([name, primary]) => azure.authorization.getRoleDefinitionOutput({ * name: name, * scope: primary.id, * })); * const builtin = azure.authorization.getRoleDefinition({ * name: "Contributor", * }); * export const customRoleDefinitionId = custom.apply(custom => custom.id); * export const contributorRoleDefinitionId = builtin.then(builtin => builtin.id); * ``` * * ## API Providers * * * This data source uses the following Azure API Providers: * * * `Microsoft.Authorization` - 2022-05-01-preview */ /** @deprecated azure.role.getRoleDefinition has been deprecated in favor of azure.authorization.getRoleDefinition */ export declare function getRoleDefinition(args?: GetRoleDefinitionArgs, opts?: pulumi.InvokeOptions): Promise; /** * A collection of arguments for invoking getRoleDefinition. */ export interface GetRoleDefinitionArgs { /** * Specifies the Name of either a built-in or custom Role Definition. * * > **Note:** You can also use this for built-in roles such as `Contributor`, `Owner`, `Reader` and `Virtual Machine Contributor` */ name?: string; /** * Specifies the ID of the Role Definition as a UUID/GUID. */ roleDefinitionId?: string; /** * Specifies the Scope at which the Custom Role Definition exists. * * > **Note:** One of `name` or `roleDefinitionId` must be specified. */ scope?: string; } /** * A collection of values returned by getRoleDefinition. */ export interface GetRoleDefinitionResult { /** * One or more assignable scopes for this Role Definition, such as `/subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333`, `/subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333/resourceGroups/myGroup`, or `/subscriptions/0b1f6471-1bf0-4dda-aec3-111122223333/resourceGroups/myGroup/providers/Microsoft.Compute/virtualMachines/myVM`. */ readonly assignableScopes: string[]; /** * The Description of the built-in Role. */ readonly description: string; /** * The provider-assigned unique ID for this managed resource. */ readonly id: string; readonly name: string; /** * A `permissions` block as documented below. */ readonly permissions: outputs.role.GetRoleDefinitionPermission[]; readonly roleDefinitionId: string; readonly scope?: string; /** * The Type of the Role. */ readonly type: string; } /** * Use this data source to access information about an existing Role Definition. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azure from "@pulumi/azure"; * * const primary = azure.core.getSubscription({}); * const customRoleDefinition = new azure.authorization.RoleDefinition("custom", { * roleDefinitionId: "00000000-0000-0000-0000-000000000000", * name: "CustomRoleDef", * scope: primary.then(primary => primary.id), * }); * const custom = pulumi.all([customRoleDefinition.roleDefinitionId, primary]).apply(([roleDefinitionId, primary]) => azure.authorization.getRoleDefinitionOutput({ * roleDefinitionId: roleDefinitionId, * scope: primary.id, * })); * const custom_byname = pulumi.all([customRoleDefinition.name, primary]).apply(([name, primary]) => azure.authorization.getRoleDefinitionOutput({ * name: name, * scope: primary.id, * })); * const builtin = azure.authorization.getRoleDefinition({ * name: "Contributor", * }); * export const customRoleDefinitionId = custom.apply(custom => custom.id); * export const contributorRoleDefinitionId = builtin.then(builtin => builtin.id); * ``` * * ## API Providers * * * This data source uses the following Azure API Providers: * * * `Microsoft.Authorization` - 2022-05-01-preview */ /** @deprecated azure.role.getRoleDefinition has been deprecated in favor of azure.authorization.getRoleDefinition */ export declare function getRoleDefinitionOutput(args?: GetRoleDefinitionOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output; /** * A collection of arguments for invoking getRoleDefinition. */ export interface GetRoleDefinitionOutputArgs { /** * Specifies the Name of either a built-in or custom Role Definition. * * > **Note:** You can also use this for built-in roles such as `Contributor`, `Owner`, `Reader` and `Virtual Machine Contributor` */ name?: pulumi.Input; /** * Specifies the ID of the Role Definition as a UUID/GUID. */ roleDefinitionId?: pulumi.Input; /** * Specifies the Scope at which the Custom Role Definition exists. * * > **Note:** One of `name` or `roleDefinitionId` must be specified. */ scope?: pulumi.Input; }