UNPKG

@pulumi/azuread

Version:

A Pulumi package for creating and managing Azure Active Directory (Azure AD) cloud resources.

106 lines 5.22 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.DirectoryRoleEligibilityScheduleRequest = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * 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 * * ```typescript * 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: example.then(example => example.objectId), * directoryScopeId: "/", * justification: "Example", * }); * ``` * * > Note the use of the `templateId` attribute when referencing built-in roles. * * ## Import * * Directory role eligibility schedule requests can be imported using the ID of the assignment, e.g. * * ```sh * $ pulumi import azuread:index/directoryRoleEligibilityScheduleRequest:DirectoryRoleEligibilityScheduleRequest example 822ec710-4c9f-4f71-a27a-451759cc7522 * ``` */ class DirectoryRoleEligibilityScheduleRequest extends pulumi.CustomResource { /** * Get an existing DirectoryRoleEligibilityScheduleRequest resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { return new DirectoryRoleEligibilityScheduleRequest(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of DirectoryRoleEligibilityScheduleRequest. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === DirectoryRoleEligibilityScheduleRequest.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["directoryScopeId"] = state ? state.directoryScopeId : undefined; resourceInputs["justification"] = state ? state.justification : undefined; resourceInputs["principalId"] = state ? state.principalId : undefined; resourceInputs["roleDefinitionId"] = state ? state.roleDefinitionId : undefined; } else { const args = argsOrState; if ((!args || args.directoryScopeId === undefined) && !opts.urn) { throw new Error("Missing required property 'directoryScopeId'"); } if ((!args || args.justification === undefined) && !opts.urn) { throw new Error("Missing required property 'justification'"); } if ((!args || args.principalId === undefined) && !opts.urn) { throw new Error("Missing required property 'principalId'"); } if ((!args || args.roleDefinitionId === undefined) && !opts.urn) { throw new Error("Missing required property 'roleDefinitionId'"); } resourceInputs["directoryScopeId"] = args ? args.directoryScopeId : undefined; resourceInputs["justification"] = args ? args.justification : undefined; resourceInputs["principalId"] = args ? args.principalId : undefined; resourceInputs["roleDefinitionId"] = args ? args.roleDefinitionId : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(DirectoryRoleEligibilityScheduleRequest.__pulumiType, name, resourceInputs, opts); } } exports.DirectoryRoleEligibilityScheduleRequest = DirectoryRoleEligibilityScheduleRequest; /** @internal */ DirectoryRoleEligibilityScheduleRequest.__pulumiType = 'azuread:index/directoryRoleEligibilityScheduleRequest:DirectoryRoleEligibilityScheduleRequest'; //# sourceMappingURL=directoryRoleEligibilityScheduleRequest.js.map