@pulumi/azuread
Version:
A Pulumi package for creating and managing Azure Active Directory (Azure AD) cloud resources.
90 lines • 4.04 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.DirectoryRoleMember = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Manages a single directory role membership (assignment) within Azure Active Directory.
*
* > **Deprecation Warning:** This resource has been superseded by the azuread.DirectoryRoleAssignment resource and will be removed in version 3.0 of the AzureAD provider
*
* ## 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 = azuread.getUser({
* userPrincipalName: "jdoe@example.com",
* });
* const exampleDirectoryRole = new azuread.DirectoryRole("example", {displayName: "Security administrator"});
* const exampleDirectoryRoleMember = new azuread.DirectoryRoleMember("example", {
* roleObjectId: exampleDirectoryRole.objectId,
* memberObjectId: example.then(example => example.objectId),
* });
* ```
*
* ## Import
*
* Directory role members can be imported using the object ID of the role and the object ID of the member, e.g.
*
* ```sh
* $ pulumi import azuread:index/directoryRoleMember:DirectoryRoleMember example 00000000-0000-0000-0000-000000000000/member/11111111-1111-1111-1111-111111111111
* ```
*
* -> This ID format is unique to Terraform and is composed of the Directory Role Object ID and the target Member Object ID in the format `{RoleObjectID}/member/{MemberObjectID}`.
*/
class DirectoryRoleMember extends pulumi.CustomResource {
/**
* Get an existing DirectoryRoleMember 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 DirectoryRoleMember(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of DirectoryRoleMember. 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'] === DirectoryRoleMember.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["memberObjectId"] = state?.memberObjectId;
resourceInputs["roleObjectId"] = state?.roleObjectId;
}
else {
const args = argsOrState;
resourceInputs["memberObjectId"] = args?.memberObjectId;
resourceInputs["roleObjectId"] = args?.roleObjectId;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(DirectoryRoleMember.__pulumiType, name, resourceInputs, opts);
}
}
exports.DirectoryRoleMember = DirectoryRoleMember;
/** @internal */
DirectoryRoleMember.__pulumiType = 'azuread:index/directoryRoleMember:DirectoryRoleMember';
//# sourceMappingURL=directoryRoleMember.js.map