-
Notifications
You must be signed in to change notification settings - Fork 301
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update invitation resource and docs, add user_type property, remove s…
…end_invitation_message and add more tests
- Loading branch information
1 parent
c2f401d
commit bf63cc0
Showing
9 changed files
with
306 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,13 @@ subcategory: "Invitations" | |
|
||
Manages an invitation of a guest user within Azure Active Directory. | ||
|
||
-> **NOTE:** If you're authenticating using a Service Principal then it must have permissions to `User.ReadWrite.All` within the `Microsoft Graph` API. | ||
## 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 | ||
|
||
|
@@ -19,20 +25,30 @@ resource "azuread_invitation" "example" { | |
} | ||
``` | ||
|
||
*Invitation with custom email* | ||
*Invitation with standard message* | ||
|
||
```terraform | ||
resource "azuread_invitation" "example" { | ||
user_email_address = "[email protected]" | ||
redirect_url = "https://portal.azure.com" | ||
user_message_info { | ||
language = "en-US" | ||
} | ||
} | ||
``` | ||
|
||
*Invitation with custom message and a CC recipient* | ||
|
||
```terraform | ||
resource "azuread_invitation" "example" { | ||
user_display_name = "Bob Bobson" | ||
user_email_address = "[email protected]" | ||
redirect_url = "https://portal.azure.com" | ||
send_invitation_message = true | ||
user_message_info { | ||
cc_recipients = ["[email protected]"] | ||
customised_message_body = "Hello there! You are invited to join my Azure tenant !" | ||
message_language = "en-US" | ||
cc_recipients = ["[email protected]"] | ||
customized_body = "Hello there! You are invited to join my Azure tenant!" | ||
} | ||
} | ||
``` | ||
|
@@ -41,25 +57,28 @@ resource "azuread_invitation" "example" { | |
|
||
The following arguments are supported: | ||
|
||
* `redirect_url` - (Required) URL the user should be redirected to once the invitation is redeemed. | ||
* `send_invitation_message` - (Optional) If `true`, an email will be sent to the user being invited. Must be set to `true` if a `user_message_info` block is specified. Defaults to `false`. | ||
* `user_display_name` - (Optional) Display name of the user being invited. | ||
* `user_email_address` - (Required) Email address of the user being invited. | ||
* `user_message_info` - (Optional) A `user_message_info` block as documented below, which configures the message being sent to the invited user. `send_invitation_message` must be set to `true` if this block is specified. | ||
* `redirect_url` - (Required) The URL that the user should be redirected to once the invitation is redeemed. | ||
* `user_display_name` - (Optional) The display name of the user being invited. | ||
* `user_email_address` - (Required) The email address of the user being invited. | ||
* `user_message` - (Optional) A `user_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_type` - (Optional) 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`. | ||
|
||
--- | ||
|
||
`user_message_info` block supports the following: | ||
`user_message` block supports the following: | ||
|
||
* `cc_recipients` - (Optional) Additional recipients the invitation message should be sent to. Currently only 1 additional recipient is supported by Azure. | ||
* `customised_message_body` - (Optional) Customised message body you want to send if you don't want the default message. | ||
* `message_language` - (Optional) Language the message will be sent in. The value specified must be in ISO 639 format. Defaults to `en-US`. | ||
* `cc_recipients` - (Optional) Email addresses of additional recipients the invitation message should be sent to. Only 1 additional recipient is currently supported by Azure. | ||
* `customized_body` - (Optional) Customized message body you want to send if you don't want to send the default message. Cannot be specified with `language`. | ||
* `language` - (Optional) 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 `customized_body`. | ||
|
||
|
||
## Attributes Reference | ||
|
||
In addition to all arguments above, the following attributes are exported: | ||
|
||
* `id` - ID of the invitation. | ||
* `redeem_url` - URL the user can use to redeem the invitation. | ||
* `user_id` - Object ID of the invited user. | ||
* `redeem_url` - The URL the user can use to redeem their invitation. | ||
* `user_id` - Object ID of the invited user. | ||
|
||
## Import | ||
|
||
This resource does not support importing. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.