Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 40 additions & 8 deletions docs/resources/iam_user.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,29 @@ For more information, see the [API documentation](https://www.scaleway.com/en/de

## Example Usage

### Basic
### Guest user

```terraform
resource "scaleway_iam_user" "basic" {
email = "[email protected]"
resource "scaleway_iam_user" "guest" {
email = "[email protected]"
tags = ["test-tag"]
}
```

### Member user

```terraform
resource "scaleway_iam_user" "member" {
email = "[email protected]"
tags = ["test-tag"]
username = "foo"
first_name = "Foo"
last_name = "Bar"
}
```

When `username` is set, the user is created as a [Member](https://www.scaleway.com/en/docs/iam/concepts/#member). Otherwise, it is created as a [Guest](https://www.scaleway.com/en/docs/iam/concepts/#guest).

### Multiple users

```terraform
Expand All @@ -28,35 +43,52 @@ locals {
])
}

resource scaleway_iam_user user {
resource "scaleway_iam_user" "user" {
for_each = local.users
email = each.key
}
```

## Argument Reference

- `email` - (Required) The email of the IAM user.
- `organization_id` - (Defaults to [provider](../index.md#organization_id) `organization_id`) The ID of the organization the user is associated with.

- `email` - (Required) The email of the IAM user. For Guest users, this argument is not editable.

- `tags` - (Optional) The tags associated with the user.

- `organization_id` - (Defaults to [provider](../index.md#organization_d) `organization_id`) The ID of the organization the user is associated with.
- `username` - (Optional) The username of the IAM user. When it is set, the user is created as a Member. When it is not set, the user is created as a Guest and the username is set as equal to the email.

- `password` - The password for first access.

- `send_password_email` - Whether or not to send an email containing the password for first access.

- `send_welcome_email` - Whether or not to send a welcome email that includes onboarding information.

- `first_name` - The user's first name.

- `last_name` - The user's last name.

- `phone_number` - The user's phone number.

- `locale` - The user's locale (e.g., en_US).

Important: When creating a Guest user, all arguments are ignored, except for `organization_id`, `email` and `tags`.

## Attributes Reference

In addition to all arguments above, the following attributes are exported:

- `id` - The ID of the user (UUID format).
- `email` - The email of the user
- `created_at` - The date and time of the creation of the IAM user.
- `updated_at` - The date and time of the last update of the IAM user.
- `deletable` - Whether the IAM user is deletable.
- `organization_id` - The ID of the organization the user.
- `last_login_at` - The date of the last login.
- `type` - The type of user. Check the possible values in the [API doc](https://www.scaleway.com/en/developers/api/iam/#path-users-get-a-given-user).
- `status` - The status of user invitation. Check the possible values in the [API doc](https://www.scaleway.com/en/developers/api/iam/#path-users-get-a-given-user).
- `mfa` - Whether the MFA is enabled.
- `account_root_user_id` - The ID of the account root user associated with the user.
- `locked` - Whether the user is locked.

## Import

Expand Down
Loading
Loading