@pulumi/azuread
Version:
A Pulumi package for creating and managing Azure Active Directory (Azure AD) cloud resources.
122 lines • 5.56 kB
JavaScript
;
// *** 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, Object.assign(Object.assign({}, 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 ? state.description : undefined;
resourceInputs["displayName"] = state ? state.displayName : undefined;
resourceInputs["enabled"] = state ? state.enabled : undefined;
resourceInputs["objectId"] = state ? state.objectId : undefined;
resourceInputs["permissions"] = state ? state.permissions : undefined;
resourceInputs["templateId"] = state ? state.templateId : undefined;
resourceInputs["version"] = state ? state.version : undefined;
}
else {
const args = argsOrState;
if ((!args || args.displayName === undefined) && !opts.urn) {
throw new Error("Missing required property 'displayName'");
}
if ((!args || args.enabled === undefined) && !opts.urn) {
throw new Error("Missing required property 'enabled'");
}
if ((!args || args.permissions === undefined) && !opts.urn) {
throw new Error("Missing required property 'permissions'");
}
if ((!args || args.version === undefined) && !opts.urn) {
throw new Error("Missing required property 'version'");
}
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["displayName"] = args ? args.displayName : undefined;
resourceInputs["enabled"] = args ? args.enabled : undefined;
resourceInputs["permissions"] = args ? args.permissions : undefined;
resourceInputs["templateId"] = args ? args.templateId : undefined;
resourceInputs["version"] = args ? args.version : undefined;
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