Skip to content

Commit c26f492

Browse files
authored
Merge branch 'master' into rm-force-new-block
2 parents 43cb76e + fb5161c commit c26f492

File tree

6 files changed

+283
-393
lines changed

6 files changed

+283
-393
lines changed

docs/resources/iam_user.md

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,15 @@ page_title: "Scaleway: scaleway_iam_user"
55

66
# Resource: scaleway_iam_user
77

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

1111
## Example Usage
1212

13-
### Guest user
13+
### User
1414

1515
```terraform
16-
resource "scaleway_iam_user" "guest" {
17-
18-
tags = ["test-tag"]
19-
}
20-
```
21-
22-
### Member user
23-
24-
```terraform
25-
resource "scaleway_iam_user" "member" {
16+
resource "scaleway_iam_user" "user" {
2617
2718
tags = ["test-tag"]
2819
username = "foo"
@@ -31,21 +22,26 @@ resource "scaleway_iam_user" "member" {
3122
}
3223
```
3324

34-
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).
35-
3625
### Multiple users
3726

3827
```terraform
3928
locals {
40-
users = toset([
41-
42-
43-
])
29+
users = [
30+
{
31+
32+
username = "test"
33+
},
34+
{
35+
36+
username = "test2"
37+
}
38+
]
4439
}
4540
46-
resource "scaleway_iam_user" "user" {
47-
for_each = local.users
48-
email = each.key
41+
resource "scaleway_iam_user" "users" {
42+
count = length(local.users)
43+
email = local.users[count.index].email
44+
username = local.users[count.index].username
4945
}
5046
```
5147

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

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

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

6258
- `password` - The password for first access.
6359

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

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

76-
Important: When creating a Guest user, all arguments are ignored, except for `organization_id`, `email` and `tags`.
77-
7872
## Attributes Reference
7973

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

0 commit comments

Comments
 (0)