UNPKG

@pulumi/azuread

Version:

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

147 lines 6.91 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.AccessPackageAssignmentPolicy = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Manages an assignment policy for an access package within Identity Governance in 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 the following application role: `EntitlementManagement.ReadWrite.All`. * * When authenticated with a user principal, this resource requires `Global Administrator` directory role, or one of the `Catalog Owner` and `Access Package Manager` role in Identity Governance. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azuread from "@pulumi/azuread"; * * const example = new azuread.Group("example", { * displayName: "group-name", * securityEnabled: true, * }); * const exampleAccessPackageCatalog = new azuread.AccessPackageCatalog("example", { * displayName: "example-catalog", * description: "Example catalog", * }); * const exampleAccessPackage = new azuread.AccessPackage("example", { * catalogId: exampleAccessPackageCatalog.id, * displayName: "access-package", * description: "Access Package", * }); * const exampleAccessPackageAssignmentPolicy = new azuread.AccessPackageAssignmentPolicy("example", { * accessPackageId: exampleAccessPackage.id, * displayName: "assignment-policy", * description: "My assignment policy", * durationInDays: 90, * requestorSettings: { * scopeType: "AllExistingDirectoryMemberUsers", * }, * approvalSettings: { * approvalRequired: true, * approvalStages: [{ * approvalTimeoutInDays: 14, * primaryApprovers: [{ * objectId: example.objectId, * subjectType: "groupMembers", * }], * }], * }, * assignmentReviewSettings: { * enabled: true, * reviewFrequency: "weekly", * durationInDays: 3, * reviewType: "Self", * accessReviewTimeoutBehavior: "keepAccess", * }, * questions: [{ * text: { * defaultText: "hello, how are you?", * }, * }], * }); * ``` * * ## Import * * An access package assignment policy can be imported using the ID, e.g. * * ```sh * $ pulumi import azuread:index/accessPackageAssignmentPolicy:AccessPackageAssignmentPolicy example 00000000-0000-0000-0000-000000000000 * ``` */ class AccessPackageAssignmentPolicy extends pulumi.CustomResource { /** * Get an existing AccessPackageAssignmentPolicy 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 AccessPackageAssignmentPolicy(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of AccessPackageAssignmentPolicy. 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'] === AccessPackageAssignmentPolicy.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["accessPackageId"] = state ? state.accessPackageId : undefined; resourceInputs["approvalSettings"] = state ? state.approvalSettings : undefined; resourceInputs["assignmentReviewSettings"] = state ? state.assignmentReviewSettings : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["displayName"] = state ? state.displayName : undefined; resourceInputs["durationInDays"] = state ? state.durationInDays : undefined; resourceInputs["expirationDate"] = state ? state.expirationDate : undefined; resourceInputs["extensionEnabled"] = state ? state.extensionEnabled : undefined; resourceInputs["questions"] = state ? state.questions : undefined; resourceInputs["requestorSettings"] = state ? state.requestorSettings : undefined; } else { const args = argsOrState; if ((!args || args.accessPackageId === undefined) && !opts.urn) { throw new Error("Missing required property 'accessPackageId'"); } if ((!args || args.description === undefined) && !opts.urn) { throw new Error("Missing required property 'description'"); } if ((!args || args.displayName === undefined) && !opts.urn) { throw new Error("Missing required property 'displayName'"); } resourceInputs["accessPackageId"] = args ? args.accessPackageId : undefined; resourceInputs["approvalSettings"] = args ? args.approvalSettings : undefined; resourceInputs["assignmentReviewSettings"] = args ? args.assignmentReviewSettings : undefined; resourceInputs["description"] = args ? args.description : undefined; resourceInputs["displayName"] = args ? args.displayName : undefined; resourceInputs["durationInDays"] = args ? args.durationInDays : undefined; resourceInputs["expirationDate"] = args ? args.expirationDate : undefined; resourceInputs["extensionEnabled"] = args ? args.extensionEnabled : undefined; resourceInputs["questions"] = args ? args.questions : undefined; resourceInputs["requestorSettings"] = args ? args.requestorSettings : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(AccessPackageAssignmentPolicy.__pulumiType, name, resourceInputs, opts); } } exports.AccessPackageAssignmentPolicy = AccessPackageAssignmentPolicy; /** @internal */ AccessPackageAssignmentPolicy.__pulumiType = 'azuread:index/accessPackageAssignmentPolicy:AccessPackageAssignmentPolicy'; //# sourceMappingURL=accessPackageAssignmentPolicy.js.map