@pulumi/azuread
Version:
A Pulumi package for creating and managing Azure Active Directory (Azure AD) cloud resources.
88 lines • 4.22 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.AdministrativeUnitMember = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Manages a single administrative unit membership within Azure Active Directory.
*
* > **Warning** Do not use this resource at the same time as the `members` property of the `azuread.AdministrativeUnit` resource for the same administrative unit. Doing so will cause a conflict and administrative unit members will be removed.
*
* ## 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: `AdministrativeUnit.ReadWrite.All` 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 exampleAdministrativeUnit = new azuread.AdministrativeUnit("example", {displayName: "Example-AU"});
* const exampleAdministrativeUnitMember = new azuread.AdministrativeUnitMember("example", {
* administrativeUnitObjectId: exampleAdministrativeUnit.id,
* memberObjectId: example.then(example => example.id),
* });
* ```
*
* ## Import
*
* Administrative unit members can be imported using the object ID of the administrative unit and the object ID of the member, e.g.
*
* ```sh
* $ pulumi import azuread:index/administrativeUnitMember:AdministrativeUnitMember example /directory/administrativeUnits/00000000-0000-0000-0000-000000000000/members/11111111-1111-1111-1111-111111111111
* ```
*/
class AdministrativeUnitMember extends pulumi.CustomResource {
/**
* Get an existing AdministrativeUnitMember 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 AdministrativeUnitMember(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of AdministrativeUnitMember. 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'] === AdministrativeUnitMember.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["administrativeUnitObjectId"] = state ? state.administrativeUnitObjectId : undefined;
resourceInputs["memberObjectId"] = state ? state.memberObjectId : undefined;
}
else {
const args = argsOrState;
resourceInputs["administrativeUnitObjectId"] = args ? args.administrativeUnitObjectId : undefined;
resourceInputs["memberObjectId"] = args ? args.memberObjectId : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(AdministrativeUnitMember.__pulumiType, name, resourceInputs, opts);
}
}
exports.AdministrativeUnitMember = AdministrativeUnitMember;
/** @internal */
AdministrativeUnitMember.__pulumiType = 'azuread:index/administrativeUnitMember:AdministrativeUnitMember';
//# sourceMappingURL=administrativeUnitMember.js.map