UNPKG

@pulumi/azuread

Version:

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

122 lines 5.25 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.CustomDirectoryRole = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Manages a Custom Directory Role within Azure Active Directory. * * This resource is for managing custom directory roles. For management of built-in roles, see the azuread.DirectoryRole resource. * * ## 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.ReadWrite.Directory` or `Directory.ReadWrite.All` * * When authenticated with a user principal, this resource 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 = new azuread.CustomDirectoryRole("example", { * displayName: "My Custom Role", * description: "Allows reading applications and updating groups", * enabled: true, * version: "1.0", * permissions: [ * { * allowedResourceActions: [ * "microsoft.directory/applications/basic/update", * "microsoft.directory/applications/create", * "microsoft.directory/applications/standard/read", * ], * }, * { * allowedResourceActions: [ * "microsoft.directory/groups/allProperties/read", * "microsoft.directory/groups/allProperties/read", * "microsoft.directory/groups/basic/update", * "microsoft.directory/groups/create", * "microsoft.directory/groups/delete", * ], * }, * ], * }); * ``` * * ## Import * * This resource does not support importing. */ class CustomDirectoryRole extends pulumi.CustomResource { /** * Get an existing CustomDirectoryRole 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 CustomDirectoryRole(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of CustomDirectoryRole. 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'] === CustomDirectoryRole.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["description"] = state?.description; resourceInputs["displayName"] = state?.displayName; resourceInputs["enabled"] = state?.enabled; resourceInputs["objectId"] = state?.objectId; resourceInputs["permissions"] = state?.permissions; resourceInputs["templateId"] = state?.templateId; resourceInputs["version"] = state?.version; } else { const args = argsOrState; if (args?.displayName === undefined && !opts.urn) { throw new Error("Missing required property 'displayName'"); } if (args?.enabled === undefined && !opts.urn) { throw new Error("Missing required property 'enabled'"); } if (args?.permissions === undefined && !opts.urn) { throw new Error("Missing required property 'permissions'"); } if (args?.version === undefined && !opts.urn) { throw new Error("Missing required property 'version'"); } resourceInputs["description"] = args?.description; resourceInputs["displayName"] = args?.displayName; resourceInputs["enabled"] = args?.enabled; resourceInputs["permissions"] = args?.permissions; resourceInputs["templateId"] = args?.templateId; resourceInputs["version"] = args?.version; resourceInputs["objectId"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(CustomDirectoryRole.__pulumiType, name, resourceInputs, opts); } } exports.CustomDirectoryRole = CustomDirectoryRole; /** @internal */ CustomDirectoryRole.__pulumiType = 'azuread:index/customDirectoryRole:CustomDirectoryRole'; //# sourceMappingURL=customDirectoryRole.js.map