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
42 changes: 18 additions & 24 deletions docs/resources/iam_user.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,15 @@ page_title: "Scaleway: scaleway_iam_user"

# Resource: scaleway_iam_user

Creates and manages Scaleway IAM Users.
Creates and manages Scaleway IAM [Users](https://www.scaleway.com/en/docs/iam/concepts/#member).
For more information, see the [API documentation](https://www.scaleway.com/en/developers/api/iam/#path-users-list-users-of-an-organization).

## Example Usage

### Guest user
### User

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

### Member user

```terraform
resource "scaleway_iam_user" "member" {
resource "scaleway_iam_user" "user" {
email = "[email protected]"
tags = ["test-tag"]
username = "foo"
Expand All @@ -31,21 +22,26 @@ resource "scaleway_iam_user" "member" {
}
```

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
locals {
users = toset([
"[email protected]",
"[email protected]"
])
users = [
{
email = "[email protected]"
username = "test"
},
{
email = "[email protected]"
username = "test2"
}
]
}

resource "scaleway_iam_user" "user" {
for_each = local.users
email = each.key
resource "scaleway_iam_user" "users" {
count = length(local.users)
email = local.users[count.index].email
username = local.users[count.index].username
}
```

Expand All @@ -57,7 +53,7 @@ resource "scaleway_iam_user" "user" {

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

- `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.
- `username` - (Required) The username of the IAM user.

- `password` - The password for first access.

Expand All @@ -73,8 +69,6 @@ resource "scaleway_iam_user" "user" {

- `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:
Expand Down
Loading
Loading