@pulumi/azuread
Version:
A Pulumi package for creating and managing Azure Active Directory (Azure AD) cloud resources.
128 lines • 5.2 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.Invitation = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* 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.
*/
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, id, state, opts) {
return new Invitation(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* 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) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Invitation.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["message"] = state ? state.message : undefined;
resourceInputs["redeemUrl"] = state ? state.redeemUrl : undefined;
resourceInputs["redirectUrl"] = state ? state.redirectUrl : undefined;
resourceInputs["userDisplayName"] = state ? state.userDisplayName : undefined;
resourceInputs["userEmailAddress"] = state ? state.userEmailAddress : undefined;
resourceInputs["userId"] = state ? state.userId : undefined;
resourceInputs["userType"] = state ? state.userType : undefined;
}
else {
const args = argsOrState;
if ((!args || args.redirectUrl === undefined) && !opts.urn) {
throw new Error("Missing required property 'redirectUrl'");
}
if ((!args || args.userEmailAddress === undefined) && !opts.urn) {
throw new Error("Missing required property 'userEmailAddress'");
}
resourceInputs["message"] = args ? args.message : undefined;
resourceInputs["redirectUrl"] = args ? args.redirectUrl : undefined;
resourceInputs["userDisplayName"] = args ? args.userDisplayName : undefined;
resourceInputs["userEmailAddress"] = args ? args.userEmailAddress : undefined;
resourceInputs["userType"] = args ? args.userType : undefined;
resourceInputs["redeemUrl"] = undefined /*out*/;
resourceInputs["userId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Invitation.__pulumiType, name, resourceInputs, opts);
}
}
exports.Invitation = Invitation;
/** @internal */
Invitation.__pulumiType = 'azuread:index/invitation:Invitation';
//# sourceMappingURL=invitation.js.map