1. Packages
  2. Azure Active Directory (Azure AD)
  3. API Docs
  4. Invitation
Azure Active Directory (Azure AD) v5.42.0 published on Friday, Sep 22, 2023 by Pulumi

azuread.Invitation

Explore with Pulumi AI

azuread logo
Azure Active Directory (Azure AD) v5.42.0 published on Friday, Sep 22, 2023 by Pulumi

    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

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureAD = Pulumi.AzureAD;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new AzureAD.Invitation("example", new()
        {
            RedirectUrl = "https://portal.azure.com",
            UserEmailAddress = "jdoe@hashicorp.com",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azuread/sdk/v5/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{
    			RedirectUrl:      pulumi.String("https://portal.azure.com"),
    			UserEmailAddress: pulumi.String("jdoe@hashicorp.com"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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()        
                .redirectUrl("https://portal.azure.com")
                .userEmailAddress("jdoe@hashicorp.com")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azuread as azuread
    
    example = azuread.Invitation("example",
        redirect_url="https://portal.azure.com",
        user_email_address="jdoe@hashicorp.com")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azuread from "@pulumi/azuread";
    
    const example = new azuread.Invitation("example", {
        redirectUrl: "https://portal.azure.com",
        userEmailAddress: "jdoe@hashicorp.com",
    });
    
    resources:
      example:
        type: azuread:Invitation
        properties:
          redirectUrl: https://portal.azure.com
          userEmailAddress: jdoe@hashicorp.com
    

    Invitation with standard message

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureAD = Pulumi.AzureAD;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new AzureAD.Invitation("example", new()
        {
            Message = new AzureAD.Inputs.InvitationMessageArgs
            {
                Language = "en-US",
            },
            RedirectUrl = "https://portal.azure.com",
            UserEmailAddress = "jdoe@hashicorp.com",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azuread/sdk/v5/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{
    			Message: &azuread.InvitationMessageArgs{
    				Language: pulumi.String("en-US"),
    			},
    			RedirectUrl:      pulumi.String("https://portal.azure.com"),
    			UserEmailAddress: pulumi.String("jdoe@hashicorp.com"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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()        
                .message(InvitationMessageArgs.builder()
                    .language("en-US")
                    .build())
                .redirectUrl("https://portal.azure.com")
                .userEmailAddress("jdoe@hashicorp.com")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azuread as azuread
    
    example = azuread.Invitation("example",
        message=azuread.InvitationMessageArgs(
            language="en-US",
        ),
        redirect_url="https://portal.azure.com",
        user_email_address="jdoe@hashicorp.com")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azuread from "@pulumi/azuread";
    
    const example = new azuread.Invitation("example", {
        message: {
            language: "en-US",
        },
        redirectUrl: "https://portal.azure.com",
        userEmailAddress: "jdoe@hashicorp.com",
    });
    
    resources:
      example:
        type: azuread:Invitation
        properties:
          message:
            language: en-US
          redirectUrl: https://portal.azure.com
          userEmailAddress: jdoe@hashicorp.com
    

    Invitation with custom message body and an additional recipient

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureAD = Pulumi.AzureAD;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new AzureAD.Invitation("example", new()
        {
            Message = new AzureAD.Inputs.InvitationMessageArgs
            {
                AdditionalRecipients = "aaliceberg@hashicorp.com",
                Body = "Hello there! You are invited to join my Azure tenant!",
            },
            RedirectUrl = "https://portal.azure.com",
            UserDisplayName = "Bob Bobson",
            UserEmailAddress = "bbobson@hashicorp.com",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azuread/sdk/v5/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{
    			Message: &azuread.InvitationMessageArgs{
    				AdditionalRecipients: pulumi.String("aaliceberg@hashicorp.com"),
    				Body:                 pulumi.String("Hello there! You are invited to join my Azure tenant!"),
    			},
    			RedirectUrl:      pulumi.String("https://portal.azure.com"),
    			UserDisplayName:  pulumi.String("Bob Bobson"),
    			UserEmailAddress: pulumi.String("bbobson@hashicorp.com"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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()        
                .message(InvitationMessageArgs.builder()
                    .additionalRecipients("aaliceberg@hashicorp.com")
                    .body("Hello there! You are invited to join my Azure tenant!")
                    .build())
                .redirectUrl("https://portal.azure.com")
                .userDisplayName("Bob Bobson")
                .userEmailAddress("bbobson@hashicorp.com")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azuread as azuread
    
    example = azuread.Invitation("example",
        message=azuread.InvitationMessageArgs(
            additional_recipients="aaliceberg@hashicorp.com",
            body="Hello there! You are invited to join my Azure tenant!",
        ),
        redirect_url="https://portal.azure.com",
        user_display_name="Bob Bobson",
        user_email_address="bbobson@hashicorp.com")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azuread from "@pulumi/azuread";
    
    const example = new azuread.Invitation("example", {
        message: {
            additionalRecipients: "aaliceberg@hashicorp.com",
            body: "Hello there! You are invited to join my Azure tenant!",
        },
        redirectUrl: "https://portal.azure.com",
        userDisplayName: "Bob Bobson",
        userEmailAddress: "bbobson@hashicorp.com",
    });
    
    resources:
      example:
        type: azuread:Invitation
        properties:
          message:
            additionalRecipients: aaliceberg@hashicorp.com
            body: Hello there! You are invited to join my Azure tenant!
          redirectUrl: https://portal.azure.com
          userDisplayName: Bob Bobson
          userEmailAddress: bbobson@hashicorp.com
    

    Create Invitation Resource

    new Invitation(name: string, args: InvitationArgs, opts?: CustomResourceOptions);
    @overload
    def Invitation(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   message: Optional[InvitationMessageArgs] = None,
                   redirect_url: Optional[str] = None,
                   user_display_name: Optional[str] = None,
                   user_email_address: Optional[str] = None,
                   user_type: Optional[str] = None)
    @overload
    def Invitation(resource_name: str,
                   args: InvitationArgs,
                   opts: Optional[ResourceOptions] = 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.
    
    
    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.

    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

    The Invitation resource accepts the following input properties:

    RedirectUrl string

    The URL that the user should be redirected to once the invitation is redeemed.

    UserEmailAddress string

    The email address of the user being invited.

    Message Pulumi.AzureAD.Inputs.InvitationMessage

    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.

    UserDisplayName string

    The display name of the user being invited.

    UserType 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.

    RedirectUrl string

    The URL that the user should be redirected to once the invitation is redeemed.

    UserEmailAddress string

    The email address of the user being invited.

    Message InvitationMessageArgs

    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.

    UserDisplayName string

    The display name of the user being invited.

    UserType 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.

    redirectUrl String

    The URL that the user should be redirected to once the invitation is redeemed.

    userEmailAddress String

    The email address of the user being invited.

    message InvitationMessage

    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.

    userDisplayName String

    The display name of the user being invited.

    userType 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.

    redirectUrl string

    The URL that the user should be redirected to once the invitation is redeemed.

    userEmailAddress string

    The email address of the user being invited.

    message InvitationMessage

    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.

    userDisplayName string

    The display name of the user being invited.

    userType 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.

    redirect_url str

    The URL that the user should be redirected to once the invitation is redeemed.

    user_email_address str

    The email address of the user being invited.

    message InvitationMessageArgs

    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_name str

    The display name of the user being invited.

    user_type str

    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.

    redirectUrl String

    The URL that the user should be redirected to once the invitation is redeemed.

    userEmailAddress String

    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.

    userDisplayName String

    The display name of the user being invited.

    userType 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.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Invitation resource produces the following output properties:

    Id string

    The provider-assigned unique ID for this managed resource.

    RedeemUrl string

    The URL the user can use to redeem their invitation.

    UserId string

    Object ID of the invited user.

    Id string

    The provider-assigned unique ID for this managed resource.

    RedeemUrl string

    The URL the user can use to redeem their invitation.

    UserId string

    Object ID of the invited user.

    id String

    The provider-assigned unique ID for this managed resource.

    redeemUrl String

    The URL the user can use to redeem their invitation.

    userId String

    Object ID of the invited user.

    id string

    The provider-assigned unique ID for this managed resource.

    redeemUrl string

    The URL the user can use to redeem their invitation.

    userId string

    Object ID of the invited user.

    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.

    id String

    The provider-assigned unique ID for this managed resource.

    redeemUrl String

    The URL the user can use to redeem their invitation.

    userId String

    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.
    The following state arguments are supported:
    Message Pulumi.AzureAD.Inputs.InvitationMessage

    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.

    RedeemUrl string

    The URL the user can use to redeem their invitation.

    RedirectUrl string

    The URL that the user should be redirected to once the invitation is redeemed.

    UserDisplayName string

    The display name of the user being invited.

    UserEmailAddress string

    The email address of the user being invited.

    UserId string

    Object ID of the invited user.

    UserType 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.

    Message InvitationMessageArgs

    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.

    RedeemUrl string

    The URL the user can use to redeem their invitation.

    RedirectUrl string

    The URL that the user should be redirected to once the invitation is redeemed.

    UserDisplayName string

    The display name of the user being invited.

    UserEmailAddress string

    The email address of the user being invited.

    UserId string

    Object ID of the invited user.

    UserType 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.

    message InvitationMessage

    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.

    redeemUrl String

    The URL the user can use to redeem their invitation.

    redirectUrl String

    The URL that the user should be redirected to once the invitation is redeemed.

    userDisplayName String

    The display name of the user being invited.

    userEmailAddress String

    The email address of the user being invited.

    userId String

    Object ID of the invited user.

    userType 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.

    message InvitationMessage

    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.

    redeemUrl string

    The URL the user can use to redeem their invitation.

    redirectUrl string

    The URL that the user should be redirected to once the invitation is redeemed.

    userDisplayName string

    The display name of the user being invited.

    userEmailAddress string

    The email address of the user being invited.

    userId string

    Object ID of the invited user.

    userType 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.

    message InvitationMessageArgs

    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_name str

    The display name of the user being invited.

    user_email_address str

    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 or Member. Only Global Administrators can invite users as members. Defaults to Guest.

    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.

    redeemUrl String

    The URL the user can use to redeem their invitation.

    redirectUrl String

    The URL that the user should be redirected to once the invitation is redeemed.

    userDisplayName String

    The display name of the user being invited.

    userEmailAddress String

    The email address of the user being invited.

    userId String

    Object ID of the invited user.

    userType 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.

    Supporting Types

    InvitationMessage, InvitationMessageArgs

    AdditionalRecipients 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 with body.

    AdditionalRecipients 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 with body.

    additionalRecipients 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 with body.

    additionalRecipients 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 with body.

    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 with body.

    additionalRecipients 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 with body.

    Import

    This resource does not support importing.

    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.

    azuread logo
    Azure Active Directory (Azure AD) v5.42.0 published on Friday, Sep 22, 2023 by Pulumi