azuread.Invitation
Explore with Pulumi AI
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
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",
});
import pulumi
import pulumi_azuread as azuread
example = azuread.Invitation("example",
user_email_address="jdoe@example.com",
redirect_url="https://portal.azure.com")
package main
import (
"github.com/pulumi/pulumi-azuread/sdk/v6/go/azuread"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := azuread.NewInvitation(ctx, "example", &azuread.InvitationArgs{
UserEmailAddress: pulumi.String("jdoe@example.com"),
RedirectUrl: pulumi.String("https://portal.azure.com"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureAD = Pulumi.AzureAD;
return await Deployment.RunAsync(() =>
{
var example = new AzureAD.Invitation("example", new()
{
UserEmailAddress = "jdoe@example.com",
RedirectUrl = "https://portal.azure.com",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azuread.Invitation;
import com.pulumi.azuread.InvitationArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Invitation("example", InvitationArgs.builder()
.userEmailAddress("jdoe@example.com")
.redirectUrl("https://portal.azure.com")
.build());
}
}
resources:
example:
type: azuread:Invitation
properties:
userEmailAddress: jdoe@example.com
redirectUrl: https://portal.azure.com
Invitation with standard message
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",
},
});
import pulumi
import pulumi_azuread as azuread
example = azuread.Invitation("example",
user_email_address="jdoe@example.com",
redirect_url="https://portal.azure.com",
message={
"language": "en-US",
})
package main
import (
"github.com/pulumi/pulumi-azuread/sdk/v6/go/azuread"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := azuread.NewInvitation(ctx, "example", &azuread.InvitationArgs{
UserEmailAddress: pulumi.String("jdoe@example.com"),
RedirectUrl: pulumi.String("https://portal.azure.com"),
Message: &azuread.InvitationMessageArgs{
Language: pulumi.String("en-US"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureAD = Pulumi.AzureAD;
return await Deployment.RunAsync(() =>
{
var example = new AzureAD.Invitation("example", new()
{
UserEmailAddress = "jdoe@example.com",
RedirectUrl = "https://portal.azure.com",
Message = new AzureAD.Inputs.InvitationMessageArgs
{
Language = "en-US",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azuread.Invitation;
import com.pulumi.azuread.InvitationArgs;
import com.pulumi.azuread.inputs.InvitationMessageArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Invitation("example", InvitationArgs.builder()
.userEmailAddress("jdoe@example.com")
.redirectUrl("https://portal.azure.com")
.message(InvitationMessageArgs.builder()
.language("en-US")
.build())
.build());
}
}
resources:
example:
type: azuread:Invitation
properties:
userEmailAddress: jdoe@example.com
redirectUrl: https://portal.azure.com
message:
language: en-US
Invitation with custom message body and an additional recipient
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 pulumi
import pulumi_azuread as azuread
example = azuread.Invitation("example",
user_display_name="Bob Bobson",
user_email_address="bbobson@example.com",
redirect_url="https://portal.azure.com",
message={
"additional_recipients": "aaliceberg@example.com",
"body": "Hello there! You are invited to join my Azure tenant!",
})
package main
import (
"github.com/pulumi/pulumi-azuread/sdk/v6/go/azuread"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := azuread.NewInvitation(ctx, "example", &azuread.InvitationArgs{
UserDisplayName: pulumi.String("Bob Bobson"),
UserEmailAddress: pulumi.String("bbobson@example.com"),
RedirectUrl: pulumi.String("https://portal.azure.com"),
Message: &azuread.InvitationMessageArgs{
AdditionalRecipients: pulumi.String("aaliceberg@example.com"),
Body: pulumi.String("Hello there! You are invited to join my Azure tenant!"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureAD = Pulumi.AzureAD;
return await Deployment.RunAsync(() =>
{
var example = new AzureAD.Invitation("example", new()
{
UserDisplayName = "Bob Bobson",
UserEmailAddress = "bbobson@example.com",
RedirectUrl = "https://portal.azure.com",
Message = new AzureAD.Inputs.InvitationMessageArgs
{
AdditionalRecipients = "aaliceberg@example.com",
Body = "Hello there! You are invited to join my Azure tenant!",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azuread.Invitation;
import com.pulumi.azuread.InvitationArgs;
import com.pulumi.azuread.inputs.InvitationMessageArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new Invitation("example", InvitationArgs.builder()
.userDisplayName("Bob Bobson")
.userEmailAddress("bbobson@example.com")
.redirectUrl("https://portal.azure.com")
.message(InvitationMessageArgs.builder()
.additionalRecipients("aaliceberg@example.com")
.body("Hello there! You are invited to join my Azure tenant!")
.build())
.build());
}
}
resources:
example:
type: azuread:Invitation
properties:
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!
Create Invitation Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Invitation(name: string, args: InvitationArgs, opts?: CustomResourceOptions);
@overload
def Invitation(resource_name: str,
args: InvitationArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Invitation(resource_name: str,
opts: Optional[ResourceOptions] = None,
redirect_url: Optional[str] = None,
user_email_address: Optional[str] = None,
message: Optional[InvitationMessageArgs] = None,
user_display_name: Optional[str] = None,
user_type: Optional[str] = None)
func NewInvitation(ctx *Context, name string, args InvitationArgs, opts ...ResourceOption) (*Invitation, error)
public Invitation(string name, InvitationArgs args, CustomResourceOptions? opts = null)
public Invitation(String name, InvitationArgs args)
public Invitation(String name, InvitationArgs args, CustomResourceOptions options)
type: azuread:Invitation
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args InvitationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args InvitationArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args InvitationArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args InvitationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args InvitationArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var invitationResource = new AzureAD.Invitation("invitationResource", new()
{
RedirectUrl = "string",
UserEmailAddress = "string",
Message = new AzureAD.Inputs.InvitationMessageArgs
{
AdditionalRecipients = "string",
Body = "string",
Language = "string",
},
UserDisplayName = "string",
UserType = "string",
});
example, err := azuread.NewInvitation(ctx, "invitationResource", &azuread.InvitationArgs{
RedirectUrl: pulumi.String("string"),
UserEmailAddress: pulumi.String("string"),
Message: &azuread.InvitationMessageArgs{
AdditionalRecipients: pulumi.String("string"),
Body: pulumi.String("string"),
Language: pulumi.String("string"),
},
UserDisplayName: pulumi.String("string"),
UserType: pulumi.String("string"),
})
var invitationResource = new Invitation("invitationResource", InvitationArgs.builder()
.redirectUrl("string")
.userEmailAddress("string")
.message(InvitationMessageArgs.builder()
.additionalRecipients("string")
.body("string")
.language("string")
.build())
.userDisplayName("string")
.userType("string")
.build());
invitation_resource = azuread.Invitation("invitationResource",
redirect_url="string",
user_email_address="string",
message={
"additional_recipients": "string",
"body": "string",
"language": "string",
},
user_display_name="string",
user_type="string")
const invitationResource = new azuread.Invitation("invitationResource", {
redirectUrl: "string",
userEmailAddress: "string",
message: {
additionalRecipients: "string",
body: "string",
language: "string",
},
userDisplayName: "string",
userType: "string",
});
type: azuread:Invitation
properties:
message:
additionalRecipients: string
body: string
language: string
redirectUrl: string
userDisplayName: string
userEmailAddress: string
userType: string
Invitation Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Invitation resource accepts the following input properties:
- Redirect
Url string - The URL that the user should be redirected to once the invitation is redeemed.
- User
Email stringAddress - The email address of the user being invited.
- Message
Pulumi.
Azure AD. Inputs. Invitation Message - 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. - User
Display stringName - The display name of the user being invited.
- User
Type string - The user type of the user being invited. Must be one of
Guest
orMember
. Only Global Administrators can invite users as members. Defaults toGuest
.
- Redirect
Url string - The URL that the user should be redirected to once the invitation is redeemed.
- User
Email stringAddress - The email address of the user being invited.
- Message
Invitation
Message Args - 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. - User
Display stringName - The display name of the user being invited.
- User
Type string - The user type of the user being invited. Must be one of
Guest
orMember
. Only Global Administrators can invite users as members. Defaults toGuest
.
- redirect
Url String - The URL that the user should be redirected to once the invitation is redeemed.
- user
Email StringAddress - The email address of the user being invited.
- message
Invitation
Message - 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. - user
Display StringName - The display name of the user being invited.
- user
Type String - The user type of the user being invited. Must be one of
Guest
orMember
. Only Global Administrators can invite users as members. Defaults toGuest
.
- redirect
Url string - The URL that the user should be redirected to once the invitation is redeemed.
- user
Email stringAddress - The email address of the user being invited.
- message
Invitation
Message - 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. - user
Display stringName - The display name of the user being invited.
- user
Type string - The user type of the user being invited. Must be one of
Guest
orMember
. Only Global Administrators can invite users as members. Defaults toGuest
.
- redirect_
url str - The URL that the user should be redirected to once the invitation is redeemed.
- user_
email_ straddress - The email address of the user being invited.
- message
Invitation
Message Args - 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. - user_
display_ strname - The display name of the user being invited.
- user_
type str - The user type of the user being invited. Must be one of
Guest
orMember
. Only Global Administrators can invite users as members. Defaults toGuest
.
- redirect
Url String - The URL that the user should be redirected to once the invitation is redeemed.
- user
Email StringAddress - The email address of the user being invited.
- message Property Map
- 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. - user
Display StringName - The display name of the user being invited.
- user
Type String - The user type of the user being invited. Must be one of
Guest
orMember
. Only Global Administrators can invite users as members. Defaults toGuest
.
Outputs
All input properties are implicitly available as output properties. Additionally, the Invitation resource produces the following output properties:
- id str
- The provider-assigned unique ID for this managed resource.
- redeem_
url str - The URL the user can use to redeem their invitation.
- user_
id str - Object ID of the invited user.
Look up Existing Invitation Resource
Get an existing Invitation resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: InvitationState, opts?: CustomResourceOptions): Invitation
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
message: Optional[InvitationMessageArgs] = None,
redeem_url: Optional[str] = None,
redirect_url: Optional[str] = None,
user_display_name: Optional[str] = None,
user_email_address: Optional[str] = None,
user_id: Optional[str] = None,
user_type: Optional[str] = None) -> Invitation
func GetInvitation(ctx *Context, name string, id IDInput, state *InvitationState, opts ...ResourceOption) (*Invitation, error)
public static Invitation Get(string name, Input<string> id, InvitationState? state, CustomResourceOptions? opts = null)
public static Invitation get(String name, Output<String> id, InvitationState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Message
Pulumi.
Azure AD. Inputs. Invitation Message - 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. - Redeem
Url string - The URL the user can use to redeem their invitation.
- Redirect
Url string - The URL that the user should be redirected to once the invitation is redeemed.
- User
Display stringName - The display name of the user being invited.
- User
Email stringAddress - The email address of the user being invited.
- User
Id string - Object ID of the invited user.
- User
Type string - The user type of the user being invited. Must be one of
Guest
orMember
. Only Global Administrators can invite users as members. Defaults toGuest
.
- Message
Invitation
Message Args - 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. - Redeem
Url string - The URL the user can use to redeem their invitation.
- Redirect
Url string - The URL that the user should be redirected to once the invitation is redeemed.
- User
Display stringName - The display name of the user being invited.
- User
Email stringAddress - The email address of the user being invited.
- User
Id string - Object ID of the invited user.
- User
Type string - The user type of the user being invited. Must be one of
Guest
orMember
. Only Global Administrators can invite users as members. Defaults toGuest
.
- message
Invitation
Message - 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. - redeem
Url String - The URL the user can use to redeem their invitation.
- redirect
Url String - The URL that the user should be redirected to once the invitation is redeemed.
- user
Display StringName - The display name of the user being invited.
- user
Email StringAddress - The email address of the user being invited.
- user
Id String - Object ID of the invited user.
- user
Type String - The user type of the user being invited. Must be one of
Guest
orMember
. Only Global Administrators can invite users as members. Defaults toGuest
.
- message
Invitation
Message - 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. - redeem
Url string - The URL the user can use to redeem their invitation.
- redirect
Url string - The URL that the user should be redirected to once the invitation is redeemed.
- user
Display stringName - The display name of the user being invited.
- user
Email stringAddress - The email address of the user being invited.
- user
Id string - Object ID of the invited user.
- user
Type string - The user type of the user being invited. Must be one of
Guest
orMember
. Only Global Administrators can invite users as members. Defaults toGuest
.
- message
Invitation
Message Args - 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. - redeem_
url str - The URL the user can use to redeem their invitation.
- redirect_
url str - The URL that the user should be redirected to once the invitation is redeemed.
- user_
display_ strname - The display name of the user being invited.
- user_
email_ straddress - The email address of the user being invited.
- user_
id str - Object ID of the invited user.
- user_
type str - The user type of the user being invited. Must be one of
Guest
orMember
. Only Global Administrators can invite users as members. Defaults toGuest
.
- message Property Map
- 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. - redeem
Url String - The URL the user can use to redeem their invitation.
- redirect
Url String - The URL that the user should be redirected to once the invitation is redeemed.
- user
Display StringName - The display name of the user being invited.
- user
Email StringAddress - The email address of the user being invited.
- user
Id String - Object ID of the invited user.
- user
Type String - The user type of the user being invited. Must be one of
Guest
orMember
. Only Global Administrators can invite users as members. Defaults toGuest
.
Supporting Types
InvitationMessage, InvitationMessageArgs
- Additional
Recipients string - Email addresses of additional recipients the invitation message should be sent to. Only 1 additional recipient is currently supported by Azure.
- Body string
- Customized message body you want to send if you don't want to send the default message. Cannot be specified with
language
. - Language string
- The language you want to send the default message in. The value specified must be in ISO 639 format. Defaults to
en-US
. Cannot be specified withbody
.
- Additional
Recipients string - Email addresses of additional recipients the invitation message should be sent to. Only 1 additional recipient is currently supported by Azure.
- Body string
- Customized message body you want to send if you don't want to send the default message. Cannot be specified with
language
. - Language string
- The language you want to send the default message in. The value specified must be in ISO 639 format. Defaults to
en-US
. Cannot be specified withbody
.
- additional
Recipients String - Email addresses of additional recipients the invitation message should be sent to. Only 1 additional recipient is currently supported by Azure.
- body String
- Customized message body you want to send if you don't want to send the default message. Cannot be specified with
language
. - language String
- The language you want to send the default message in. The value specified must be in ISO 639 format. Defaults to
en-US
. Cannot be specified withbody
.
- additional
Recipients string - Email addresses of additional recipients the invitation message should be sent to. Only 1 additional recipient is currently supported by Azure.
- body string
- Customized message body you want to send if you don't want to send the default message. Cannot be specified with
language
. - language string
- The language you want to send the default message in. The value specified must be in ISO 639 format. Defaults to
en-US
. Cannot be specified withbody
.
- additional_
recipients str - Email addresses of additional recipients the invitation message should be sent to. Only 1 additional recipient is currently supported by Azure.
- body str
- Customized message body you want to send if you don't want to send the default message. Cannot be specified with
language
. - language str
- The language you want to send the default message in. The value specified must be in ISO 639 format. Defaults to
en-US
. Cannot be specified withbody
.
- additional
Recipients String - Email addresses of additional recipients the invitation message should be sent to. Only 1 additional recipient is currently supported by Azure.
- body String
- Customized message body you want to send if you don't want to send the default message. Cannot be specified with
language
. - language String
- The language you want to send the default message in. The value specified must be in ISO 639 format. Defaults to
en-US
. Cannot be specified withbody
.
Import
This resource does not support importing.
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Active Directory (Azure AD) pulumi/pulumi-azuread
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azuread
Terraform Provider.