@pulumi/azuread
Version:
A Pulumi package for creating and managing Azure Active Directory (Azure AD) cloud resources.
609 lines (608 loc) • 24.6 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* 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
* ```
*/
export declare 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: string, id: pulumi.Input<pulumi.ID>, state?: UserState, opts?: pulumi.CustomResourceOptions): User;
/**
* 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: any): obj is User;
/**
* A freeform field for the user to describe themselves
*/
readonly aboutMe: pulumi.Output<string>;
/**
* Whether or not the account should be enabled.
*/
readonly accountEnabled: pulumi.Output<boolean | undefined>;
/**
* The age group of the user. Supported values are `Adult`, `NotAdult` and `Minor`. Omit this property or specify a blank string to unset.
*/
readonly ageGroup: pulumi.Output<string | undefined>;
/**
* A list of telephone numbers for the user. Only one number can be set for this property. Read-only for users synced with Azure AD Connect.
*/
readonly businessPhones: pulumi.Output<string[]>;
/**
* The city in which the user is located.
*/
readonly city: pulumi.Output<string | undefined>;
/**
* The company name which the user is associated. This property can be useful for describing the company that an external user comes from.
*/
readonly companyName: pulumi.Output<string | undefined>;
/**
* Whether consent has been obtained for minors. Supported values are `Granted`, `Denied` and `NotRequired`. Omit this property or specify a blank string to unset.
*/
readonly consentProvidedForMinor: pulumi.Output<string | undefined>;
/**
* The cost center associated with the user.
*/
readonly costCenter: pulumi.Output<string | undefined>;
/**
* The country/region in which the user is located. Examples include: `NO`, `JP`, and `GB`.
*/
readonly country: pulumi.Output<string | undefined>;
/**
* Indicates whether the user account was created as a regular school or work account (`null`), an external account (`Invitation`), a local account for an Azure Active Directory B2C tenant (`LocalAccount`) or self-service sign-up using email verification (`EmailVerified`).
*/
readonly creationType: pulumi.Output<string>;
/**
* The name for the department in which the user works.
*/
readonly department: pulumi.Output<string | undefined>;
/**
* Whether the user's password is exempt from expiring. Defaults to `false`.
*/
readonly disablePasswordExpiration: pulumi.Output<boolean | undefined>;
/**
* Whether the user is allowed weaker passwords than the default policy to be specified. Defaults to `false`.
*/
readonly disableStrongPassword: pulumi.Output<boolean | undefined>;
/**
* The name to display in the address book for the user.
*/
readonly displayName: pulumi.Output<string>;
/**
* The name of the division in which the user works.
*/
readonly division: pulumi.Output<string | undefined>;
/**
* The hire date of the user, formatted as an RFC3339 date string (e.g. `2018-01-01T01:02:03Z`).
*/
readonly employeeHireDate: pulumi.Output<string | undefined>;
/**
* The employee identifier assigned to the user by the organisation.
*/
readonly employeeId: pulumi.Output<string | undefined>;
/**
* Captures enterprise worker type. For example, Employee, Contractor, Consultant, or Vendor.
*/
readonly employeeType: pulumi.Output<string | undefined>;
/**
* For an external user invited to the tenant, this property represents the invited user's invitation status. Possible values are `PendingAcceptance` or `Accepted`.
*/
readonly externalUserState: pulumi.Output<string>;
/**
* The fax number of the user.
*/
readonly faxNumber: pulumi.Output<string | undefined>;
/**
* Whether the user is forced to change the password during the next sign-in. Only takes effect when also changing the password. Defaults to `false`.
*/
readonly forcePasswordChange: pulumi.Output<boolean | undefined>;
/**
* The given name (first name) of the user.
*/
readonly givenName: pulumi.Output<string | undefined>;
/**
* A list of instant message voice over IP (VOIP) session initiation protocol (SIP) addresses for the user.
*/
readonly imAddresses: pulumi.Output<string[]>;
/**
* The user’s job title.
*/
readonly jobTitle: pulumi.Output<string | undefined>;
/**
* The SMTP address for the user. This property cannot be unset once specified.
*/
readonly mail: pulumi.Output<string>;
/**
* The mail alias for the user. Defaults to the user name part of the user principal name (UPN).
*/
readonly mailNickname: pulumi.Output<string>;
/**
* The object ID of the user's manager.
*/
readonly managerId: pulumi.Output<string | undefined>;
/**
* The primary cellular telephone number for the user.
*/
readonly mobilePhone: pulumi.Output<string | undefined>;
/**
* The object ID of the user.
*/
readonly objectId: pulumi.Output<string>;
/**
* The office location in the user's place of business.
*/
readonly officeLocation: pulumi.Output<string | undefined>;
/**
* The on-premises distinguished name (DN) of the user, synchronised from the on-premises directory when Azure AD Connect is used.
*/
readonly onpremisesDistinguishedName: pulumi.Output<string>;
/**
* The on-premises FQDN, also called dnsDomainName, synchronised from the on-premises directory when Azure AD Connect is used.
*/
readonly onpremisesDomainName: pulumi.Output<string>;
/**
* The value used to associate an on-premise Active Directory user account with their Azure AD user object. This must be specified if you are using a federated domain for the user's `userPrincipalName` property when creating a new user account.
*/
readonly onpremisesImmutableId: pulumi.Output<string>;
/**
* The on-premise SAM account name of the user.
*/
readonly onpremisesSamAccountName: pulumi.Output<string>;
/**
* The on-premises security identifier (SID), synchronised from the on-premises directory when Azure AD Connect is used.
*/
readonly onpremisesSecurityIdentifier: pulumi.Output<string>;
/**
* Whether this user is synchronised from an on-premises directory (`true`), no longer synchronised (`false`), or has never been synchronised (`null`).
*/
readonly onpremisesSyncEnabled: pulumi.Output<boolean>;
/**
* The on-premise user principal name of the user.
*/
readonly onpremisesUserPrincipalName: pulumi.Output<string>;
/**
* A list of additional email addresses for the user.
*/
readonly otherMails: pulumi.Output<string[] | undefined>;
/**
* The password for the user. The password must satisfy minimum requirements as specified by the password policy. The
* maximum length is 256 characters. This property is required when creating a new user
*/
readonly password: pulumi.Output<string>;
/**
* The postal code for the user's postal address. The postal code is specific to the user's country/region. In the United States of America, this attribute contains the ZIP code.
*/
readonly postalCode: pulumi.Output<string | undefined>;
/**
* The user's preferred language, in ISO 639-1 notation.
*/
readonly preferredLanguage: pulumi.Output<string | undefined>;
/**
* List of email addresses for the user that direct to the same mailbox.
*/
readonly proxyAddresses: pulumi.Output<string[]>;
/**
* Whether or not the Outlook global address list should include this user. Defaults to `true`.
*/
readonly showInAddressList: pulumi.Output<boolean | undefined>;
/**
* The state or province in the user's address.
*/
readonly state: pulumi.Output<string | undefined>;
/**
* The street address of the user's place of business.
*/
readonly streetAddress: pulumi.Output<string | undefined>;
/**
* The user's surname (family name or last name).
*/
readonly surname: pulumi.Output<string | undefined>;
/**
* The usage location of the user. Required for users that will be assigned licenses due to legal requirement to check for availability of services in countries. The usage location is a two letter country code (ISO standard 3166). Examples include: `NO`, `JP`, and `GB`. Cannot be reset to null once set.
*/
readonly usageLocation: pulumi.Output<string | undefined>;
/**
* The user principal name (UPN) of the user.
*/
readonly userPrincipalName: pulumi.Output<string>;
/**
* The user type in the directory. Possible values are `Guest` or `Member`.
*/
readonly userType: pulumi.Output<string>;
/**
* Create a User resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: UserArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering User resources.
*/
export interface UserState {
/**
* A freeform field for the user to describe themselves
*/
aboutMe?: pulumi.Input<string>;
/**
* Whether or not the account should be enabled.
*/
accountEnabled?: pulumi.Input<boolean>;
/**
* The age group of the user. Supported values are `Adult`, `NotAdult` and `Minor`. Omit this property or specify a blank string to unset.
*/
ageGroup?: pulumi.Input<string>;
/**
* A list of telephone numbers for the user. Only one number can be set for this property. Read-only for users synced with Azure AD Connect.
*/
businessPhones?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The city in which the user is located.
*/
city?: pulumi.Input<string>;
/**
* The company name which the user is associated. This property can be useful for describing the company that an external user comes from.
*/
companyName?: pulumi.Input<string>;
/**
* Whether consent has been obtained for minors. Supported values are `Granted`, `Denied` and `NotRequired`. Omit this property or specify a blank string to unset.
*/
consentProvidedForMinor?: pulumi.Input<string>;
/**
* The cost center associated with the user.
*/
costCenter?: pulumi.Input<string>;
/**
* The country/region in which the user is located. Examples include: `NO`, `JP`, and `GB`.
*/
country?: pulumi.Input<string>;
/**
* Indicates whether the user account was created as a regular school or work account (`null`), an external account (`Invitation`), a local account for an Azure Active Directory B2C tenant (`LocalAccount`) or self-service sign-up using email verification (`EmailVerified`).
*/
creationType?: pulumi.Input<string>;
/**
* The name for the department in which the user works.
*/
department?: pulumi.Input<string>;
/**
* Whether the user's password is exempt from expiring. Defaults to `false`.
*/
disablePasswordExpiration?: pulumi.Input<boolean>;
/**
* Whether the user is allowed weaker passwords than the default policy to be specified. Defaults to `false`.
*/
disableStrongPassword?: pulumi.Input<boolean>;
/**
* The name to display in the address book for the user.
*/
displayName?: pulumi.Input<string>;
/**
* The name of the division in which the user works.
*/
division?: pulumi.Input<string>;
/**
* The hire date of the user, formatted as an RFC3339 date string (e.g. `2018-01-01T01:02:03Z`).
*/
employeeHireDate?: pulumi.Input<string>;
/**
* The employee identifier assigned to the user by the organisation.
*/
employeeId?: pulumi.Input<string>;
/**
* Captures enterprise worker type. For example, Employee, Contractor, Consultant, or Vendor.
*/
employeeType?: pulumi.Input<string>;
/**
* For an external user invited to the tenant, this property represents the invited user's invitation status. Possible values are `PendingAcceptance` or `Accepted`.
*/
externalUserState?: pulumi.Input<string>;
/**
* The fax number of the user.
*/
faxNumber?: pulumi.Input<string>;
/**
* Whether the user is forced to change the password during the next sign-in. Only takes effect when also changing the password. Defaults to `false`.
*/
forcePasswordChange?: pulumi.Input<boolean>;
/**
* The given name (first name) of the user.
*/
givenName?: pulumi.Input<string>;
/**
* A list of instant message voice over IP (VOIP) session initiation protocol (SIP) addresses for the user.
*/
imAddresses?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The user’s job title.
*/
jobTitle?: pulumi.Input<string>;
/**
* The SMTP address for the user. This property cannot be unset once specified.
*/
mail?: pulumi.Input<string>;
/**
* The mail alias for the user. Defaults to the user name part of the user principal name (UPN).
*/
mailNickname?: pulumi.Input<string>;
/**
* The object ID of the user's manager.
*/
managerId?: pulumi.Input<string>;
/**
* The primary cellular telephone number for the user.
*/
mobilePhone?: pulumi.Input<string>;
/**
* The object ID of the user.
*/
objectId?: pulumi.Input<string>;
/**
* The office location in the user's place of business.
*/
officeLocation?: pulumi.Input<string>;
/**
* The on-premises distinguished name (DN) of the user, synchronised from the on-premises directory when Azure AD Connect is used.
*/
onpremisesDistinguishedName?: pulumi.Input<string>;
/**
* The on-premises FQDN, also called dnsDomainName, synchronised from the on-premises directory when Azure AD Connect is used.
*/
onpremisesDomainName?: pulumi.Input<string>;
/**
* The value used to associate an on-premise Active Directory user account with their Azure AD user object. This must be specified if you are using a federated domain for the user's `userPrincipalName` property when creating a new user account.
*/
onpremisesImmutableId?: pulumi.Input<string>;
/**
* The on-premise SAM account name of the user.
*/
onpremisesSamAccountName?: pulumi.Input<string>;
/**
* The on-premises security identifier (SID), synchronised from the on-premises directory when Azure AD Connect is used.
*/
onpremisesSecurityIdentifier?: pulumi.Input<string>;
/**
* Whether this user is synchronised from an on-premises directory (`true`), no longer synchronised (`false`), or has never been synchronised (`null`).
*/
onpremisesSyncEnabled?: pulumi.Input<boolean>;
/**
* The on-premise user principal name of the user.
*/
onpremisesUserPrincipalName?: pulumi.Input<string>;
/**
* A list of additional email addresses for the user.
*/
otherMails?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The password for the user. The password must satisfy minimum requirements as specified by the password policy. The
* maximum length is 256 characters. This property is required when creating a new user
*/
password?: pulumi.Input<string>;
/**
* The postal code for the user's postal address. The postal code is specific to the user's country/region. In the United States of America, this attribute contains the ZIP code.
*/
postalCode?: pulumi.Input<string>;
/**
* The user's preferred language, in ISO 639-1 notation.
*/
preferredLanguage?: pulumi.Input<string>;
/**
* List of email addresses for the user that direct to the same mailbox.
*/
proxyAddresses?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Whether or not the Outlook global address list should include this user. Defaults to `true`.
*/
showInAddressList?: pulumi.Input<boolean>;
/**
* The state or province in the user's address.
*/
state?: pulumi.Input<string>;
/**
* The street address of the user's place of business.
*/
streetAddress?: pulumi.Input<string>;
/**
* The user's surname (family name or last name).
*/
surname?: pulumi.Input<string>;
/**
* The usage location of the user. Required for users that will be assigned licenses due to legal requirement to check for availability of services in countries. The usage location is a two letter country code (ISO standard 3166). Examples include: `NO`, `JP`, and `GB`. Cannot be reset to null once set.
*/
usageLocation?: pulumi.Input<string>;
/**
* The user principal name (UPN) of the user.
*/
userPrincipalName?: pulumi.Input<string>;
/**
* The user type in the directory. Possible values are `Guest` or `Member`.
*/
userType?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a User resource.
*/
export interface UserArgs {
/**
* Whether or not the account should be enabled.
*/
accountEnabled?: pulumi.Input<boolean>;
/**
* The age group of the user. Supported values are `Adult`, `NotAdult` and `Minor`. Omit this property or specify a blank string to unset.
*/
ageGroup?: pulumi.Input<string>;
/**
* A list of telephone numbers for the user. Only one number can be set for this property. Read-only for users synced with Azure AD Connect.
*/
businessPhones?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The city in which the user is located.
*/
city?: pulumi.Input<string>;
/**
* The company name which the user is associated. This property can be useful for describing the company that an external user comes from.
*/
companyName?: pulumi.Input<string>;
/**
* Whether consent has been obtained for minors. Supported values are `Granted`, `Denied` and `NotRequired`. Omit this property or specify a blank string to unset.
*/
consentProvidedForMinor?: pulumi.Input<string>;
/**
* The cost center associated with the user.
*/
costCenter?: pulumi.Input<string>;
/**
* The country/region in which the user is located. Examples include: `NO`, `JP`, and `GB`.
*/
country?: pulumi.Input<string>;
/**
* The name for the department in which the user works.
*/
department?: pulumi.Input<string>;
/**
* Whether the user's password is exempt from expiring. Defaults to `false`.
*/
disablePasswordExpiration?: pulumi.Input<boolean>;
/**
* Whether the user is allowed weaker passwords than the default policy to be specified. Defaults to `false`.
*/
disableStrongPassword?: pulumi.Input<boolean>;
/**
* The name to display in the address book for the user.
*/
displayName: pulumi.Input<string>;
/**
* The name of the division in which the user works.
*/
division?: pulumi.Input<string>;
/**
* The hire date of the user, formatted as an RFC3339 date string (e.g. `2018-01-01T01:02:03Z`).
*/
employeeHireDate?: pulumi.Input<string>;
/**
* The employee identifier assigned to the user by the organisation.
*/
employeeId?: pulumi.Input<string>;
/**
* Captures enterprise worker type. For example, Employee, Contractor, Consultant, or Vendor.
*/
employeeType?: pulumi.Input<string>;
/**
* The fax number of the user.
*/
faxNumber?: pulumi.Input<string>;
/**
* Whether the user is forced to change the password during the next sign-in. Only takes effect when also changing the password. Defaults to `false`.
*/
forcePasswordChange?: pulumi.Input<boolean>;
/**
* The given name (first name) of the user.
*/
givenName?: pulumi.Input<string>;
/**
* The user’s job title.
*/
jobTitle?: pulumi.Input<string>;
/**
* The SMTP address for the user. This property cannot be unset once specified.
*/
mail?: pulumi.Input<string>;
/**
* The mail alias for the user. Defaults to the user name part of the user principal name (UPN).
*/
mailNickname?: pulumi.Input<string>;
/**
* The object ID of the user's manager.
*/
managerId?: pulumi.Input<string>;
/**
* The primary cellular telephone number for the user.
*/
mobilePhone?: pulumi.Input<string>;
/**
* The office location in the user's place of business.
*/
officeLocation?: pulumi.Input<string>;
/**
* The value used to associate an on-premise Active Directory user account with their Azure AD user object. This must be specified if you are using a federated domain for the user's `userPrincipalName` property when creating a new user account.
*/
onpremisesImmutableId?: pulumi.Input<string>;
/**
* A list of additional email addresses for the user.
*/
otherMails?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The password for the user. The password must satisfy minimum requirements as specified by the password policy. The
* maximum length is 256 characters. This property is required when creating a new user
*/
password?: pulumi.Input<string>;
/**
* The postal code for the user's postal address. The postal code is specific to the user's country/region. In the United States of America, this attribute contains the ZIP code.
*/
postalCode?: pulumi.Input<string>;
/**
* The user's preferred language, in ISO 639-1 notation.
*/
preferredLanguage?: pulumi.Input<string>;
/**
* Whether or not the Outlook global address list should include this user. Defaults to `true`.
*/
showInAddressList?: pulumi.Input<boolean>;
/**
* The state or province in the user's address.
*/
state?: pulumi.Input<string>;
/**
* The street address of the user's place of business.
*/
streetAddress?: pulumi.Input<string>;
/**
* The user's surname (family name or last name).
*/
surname?: pulumi.Input<string>;
/**
* The usage location of the user. Required for users that will be assigned licenses due to legal requirement to check for availability of services in countries. The usage location is a two letter country code (ISO standard 3166). Examples include: `NO`, `JP`, and `GB`. Cannot be reset to null once set.
*/
usageLocation?: pulumi.Input<string>;
/**
* The user principal name (UPN) of the user.
*/
userPrincipalName: pulumi.Input<string>;
}