UNPKG

@pulumi/azuread

Version:

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

176 lines (175 loc) 6.45 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * Manages an invitation of a guest 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.Invite.All`, `User.ReadWrite.All` or `Directory.ReadWrite.All` * * When authenticated with a user principal, this resource requires one of the following directory roles: `Guest Inviter`, `User Administrator` or `Global Administrator` * * ## Example Usage * * *Basic example* * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azuread from "@pulumi/azuread"; * * const example = new azuread.Invitation("example", { * userEmailAddress: "jdoe@example.com", * redirectUrl: "https://portal.azure.com", * }); * ``` * * *Invitation with standard message* * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azuread from "@pulumi/azuread"; * * const example = new azuread.Invitation("example", { * userEmailAddress: "jdoe@example.com", * redirectUrl: "https://portal.azure.com", * message: { * language: "en-US", * }, * }); * ``` * * *Invitation with custom message body and an additional recipient* * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azuread from "@pulumi/azuread"; * * const example = new azuread.Invitation("example", { * userDisplayName: "Bob Bobson", * userEmailAddress: "bbobson@example.com", * redirectUrl: "https://portal.azure.com", * message: { * additionalRecipients: "aaliceberg@example.com", * body: "Hello there! You are invited to join my Azure tenant!", * }, * }); * ``` * * ## Import * * This resource does not support importing. */ export declare class Invitation extends pulumi.CustomResource { /** * Get an existing Invitation 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?: InvitationState, opts?: pulumi.CustomResourceOptions): Invitation; /** * Returns true if the given object is an instance of Invitation. 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 Invitation; /** * A `message` block as documented below, which configures the message being sent to the invited user. If this block is omitted, no message will be sent. */ readonly message: pulumi.Output<outputs.InvitationMessage | undefined>; /** * The URL the user can use to redeem their invitation. */ readonly redeemUrl: pulumi.Output<string>; /** * The URL that the user should be redirected to once the invitation is redeemed. */ readonly redirectUrl: pulumi.Output<string>; /** * The display name of the user being invited. */ readonly userDisplayName: pulumi.Output<string | undefined>; /** * The email address of the user being invited. */ readonly userEmailAddress: pulumi.Output<string>; /** * Object ID of the invited user. */ readonly userId: pulumi.Output<string>; /** * The user type of the user being invited. Must be one of `Guest` or `Member`. Only Global Administrators can invite users as members. Defaults to `Guest`. */ readonly userType: pulumi.Output<string | undefined>; /** * Create a Invitation 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: InvitationArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Invitation resources. */ export interface InvitationState { /** * A `message` block as documented below, which configures the message being sent to the invited user. If this block is omitted, no message will be sent. */ message?: pulumi.Input<inputs.InvitationMessage>; /** * The URL the user can use to redeem their invitation. */ redeemUrl?: pulumi.Input<string>; /** * The URL that the user should be redirected to once the invitation is redeemed. */ redirectUrl?: pulumi.Input<string>; /** * The display name of the user being invited. */ userDisplayName?: pulumi.Input<string>; /** * The email address of the user being invited. */ userEmailAddress?: pulumi.Input<string>; /** * Object ID of the invited user. */ userId?: pulumi.Input<string>; /** * The user type of the user being invited. Must be one of `Guest` or `Member`. Only Global Administrators can invite users as members. Defaults to `Guest`. */ userType?: pulumi.Input<string>; } /** * The set of arguments for constructing a Invitation resource. */ export interface InvitationArgs { /** * A `message` block as documented below, which configures the message being sent to the invited user. If this block is omitted, no message will be sent. */ message?: pulumi.Input<inputs.InvitationMessage>; /** * The URL that the user should be redirected to once the invitation is redeemed. */ redirectUrl: pulumi.Input<string>; /** * The display name of the user being invited. */ userDisplayName?: pulumi.Input<string>; /** * The email address of the user being invited. */ userEmailAddress: pulumi.Input<string>; /** * The user type of the user being invited. Must be one of `Guest` or `Member`. Only Global Administrators can invite users as members. Defaults to `Guest`. */ userType?: pulumi.Input<string>; }