UNPKG

@pulumi/azuread

Version:

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

186 lines • 9.93 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.User = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Manages a user within 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 one of the following application roles: `User.ReadWrite.All` or `Directory.ReadWrite.All` * * When authenticated with a user principal, this resource requires one of the following directory roles: `User Administrator` or `Global Administrator` * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azuread from "@pulumi/azuread"; * * const example = new azuread.User("example", { * userPrincipalName: "jdoe@example.com", * displayName: "J. Doe", * mailNickname: "jdoe", * password: "SecretP@sswd99!", * }); * ``` * * ## Import * * Users can be imported using their object ID, e.g. * * ```sh * $ pulumi import azuread:index/user:User my_user /users/00000000-0000-0000-0000-000000000000 * ``` */ class User extends pulumi.CustomResource { /** * Get an existing User 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 User(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of User. 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'] === User.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["aboutMe"] = state?.aboutMe; resourceInputs["accountEnabled"] = state?.accountEnabled; resourceInputs["ageGroup"] = state?.ageGroup; resourceInputs["businessPhones"] = state?.businessPhones; resourceInputs["city"] = state?.city; resourceInputs["companyName"] = state?.companyName; resourceInputs["consentProvidedForMinor"] = state?.consentProvidedForMinor; resourceInputs["costCenter"] = state?.costCenter; resourceInputs["country"] = state?.country; resourceInputs["creationType"] = state?.creationType; resourceInputs["department"] = state?.department; resourceInputs["disablePasswordExpiration"] = state?.disablePasswordExpiration; resourceInputs["disableStrongPassword"] = state?.disableStrongPassword; resourceInputs["displayName"] = state?.displayName; resourceInputs["division"] = state?.division; resourceInputs["employeeHireDate"] = state?.employeeHireDate; resourceInputs["employeeId"] = state?.employeeId; resourceInputs["employeeType"] = state?.employeeType; resourceInputs["externalUserState"] = state?.externalUserState; resourceInputs["faxNumber"] = state?.faxNumber; resourceInputs["forcePasswordChange"] = state?.forcePasswordChange; resourceInputs["givenName"] = state?.givenName; resourceInputs["imAddresses"] = state?.imAddresses; resourceInputs["jobTitle"] = state?.jobTitle; resourceInputs["mail"] = state?.mail; resourceInputs["mailNickname"] = state?.mailNickname; resourceInputs["managerId"] = state?.managerId; resourceInputs["mobilePhone"] = state?.mobilePhone; resourceInputs["objectId"] = state?.objectId; resourceInputs["officeLocation"] = state?.officeLocation; resourceInputs["onpremisesDistinguishedName"] = state?.onpremisesDistinguishedName; resourceInputs["onpremisesDomainName"] = state?.onpremisesDomainName; resourceInputs["onpremisesImmutableId"] = state?.onpremisesImmutableId; resourceInputs["onpremisesSamAccountName"] = state?.onpremisesSamAccountName; resourceInputs["onpremisesSecurityIdentifier"] = state?.onpremisesSecurityIdentifier; resourceInputs["onpremisesSyncEnabled"] = state?.onpremisesSyncEnabled; resourceInputs["onpremisesUserPrincipalName"] = state?.onpremisesUserPrincipalName; resourceInputs["otherMails"] = state?.otherMails; resourceInputs["password"] = state?.password; resourceInputs["postalCode"] = state?.postalCode; resourceInputs["preferredLanguage"] = state?.preferredLanguage; resourceInputs["proxyAddresses"] = state?.proxyAddresses; resourceInputs["showInAddressList"] = state?.showInAddressList; resourceInputs["state"] = state?.state; resourceInputs["streetAddress"] = state?.streetAddress; resourceInputs["surname"] = state?.surname; resourceInputs["usageLocation"] = state?.usageLocation; resourceInputs["userPrincipalName"] = state?.userPrincipalName; resourceInputs["userType"] = state?.userType; } else { const args = argsOrState; if (args?.displayName === undefined && !opts.urn) { throw new Error("Missing required property 'displayName'"); } if (args?.userPrincipalName === undefined && !opts.urn) { throw new Error("Missing required property 'userPrincipalName'"); } resourceInputs["accountEnabled"] = args?.accountEnabled; resourceInputs["ageGroup"] = args?.ageGroup; resourceInputs["businessPhones"] = args?.businessPhones; resourceInputs["city"] = args?.city; resourceInputs["companyName"] = args?.companyName; resourceInputs["consentProvidedForMinor"] = args?.consentProvidedForMinor; resourceInputs["costCenter"] = args?.costCenter; resourceInputs["country"] = args?.country; resourceInputs["department"] = args?.department; resourceInputs["disablePasswordExpiration"] = args?.disablePasswordExpiration; resourceInputs["disableStrongPassword"] = args?.disableStrongPassword; resourceInputs["displayName"] = args?.displayName; resourceInputs["division"] = args?.division; resourceInputs["employeeHireDate"] = args?.employeeHireDate; resourceInputs["employeeId"] = args?.employeeId; resourceInputs["employeeType"] = args?.employeeType; resourceInputs["faxNumber"] = args?.faxNumber; resourceInputs["forcePasswordChange"] = args?.forcePasswordChange; resourceInputs["givenName"] = args?.givenName; resourceInputs["jobTitle"] = args?.jobTitle; resourceInputs["mail"] = args?.mail; resourceInputs["mailNickname"] = args?.mailNickname; resourceInputs["managerId"] = args?.managerId; resourceInputs["mobilePhone"] = args?.mobilePhone; resourceInputs["officeLocation"] = args?.officeLocation; resourceInputs["onpremisesImmutableId"] = args?.onpremisesImmutableId; resourceInputs["otherMails"] = args?.otherMails; resourceInputs["password"] = args?.password ? pulumi.secret(args.password) : undefined; resourceInputs["postalCode"] = args?.postalCode; resourceInputs["preferredLanguage"] = args?.preferredLanguage; resourceInputs["showInAddressList"] = args?.showInAddressList; resourceInputs["state"] = args?.state; resourceInputs["streetAddress"] = args?.streetAddress; resourceInputs["surname"] = args?.surname; resourceInputs["usageLocation"] = args?.usageLocation; resourceInputs["userPrincipalName"] = args?.userPrincipalName; resourceInputs["aboutMe"] = undefined /*out*/; resourceInputs["creationType"] = undefined /*out*/; resourceInputs["externalUserState"] = undefined /*out*/; resourceInputs["imAddresses"] = undefined /*out*/; resourceInputs["objectId"] = undefined /*out*/; resourceInputs["onpremisesDistinguishedName"] = undefined /*out*/; resourceInputs["onpremisesDomainName"] = undefined /*out*/; resourceInputs["onpremisesSamAccountName"] = undefined /*out*/; resourceInputs["onpremisesSecurityIdentifier"] = undefined /*out*/; resourceInputs["onpremisesSyncEnabled"] = undefined /*out*/; resourceInputs["onpremisesUserPrincipalName"] = undefined /*out*/; resourceInputs["proxyAddresses"] = undefined /*out*/; resourceInputs["userType"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["password"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(User.__pulumiType, name, resourceInputs, opts); } } exports.User = User; /** @internal */ User.__pulumiType = 'azuread:index/user:User'; //# sourceMappingURL=user.js.map