|
| 1 | +--- |
| 2 | +layout: "gitlab" |
| 3 | +page_title: "GitLab: gitlab_users" |
| 4 | +sidebar_current: "docs-gitlab-data-source-users" |
| 5 | +description: |- |
| 6 | + Looks up gitlab users |
| 7 | +--- |
| 8 | + |
| 9 | +# gitlab\_users |
| 10 | + |
| 11 | +Provides details about a list of users in the gitlab provider. The results include id, username, email, name and more about the requested users. Users can also be sorted and filtered using several options. |
| 12 | + |
| 13 | +## Example Usage |
| 14 | + |
| 15 | +```hcl |
| 16 | +data "gitlab_users" "example" { |
| 17 | + sort = "desc" |
| 18 | + order_by = "name" |
| 19 | + created_before = "2019-01-01" |
| 20 | +} |
| 21 | +``` |
| 22 | + |
| 23 | +## Argument Reference |
| 24 | + |
| 25 | +The following arguments are supported: |
| 26 | + |
| 27 | +* `search` - (Optional) Search users by username, name or email. |
| 28 | + |
| 29 | +* `active` - (Optional) Filter users that are active. |
| 30 | + |
| 31 | +* `blocked` - (Optional) Filter users that are blocked. |
| 32 | + |
| 33 | +* `order_by` - (Optional) Order the users' list by `id`, `name`, `username`, `created_at` or `updated_at`. (Requires administrator privileges) |
| 34 | + |
| 35 | +* `sort` - (Optional) Sort users' list in asc or desc order. (Requires administrator privileges) |
| 36 | + |
| 37 | +* `identities_extern_uid` - (Optional) Lookup users by external UID. (Requires administrator privileges) |
| 38 | + |
| 39 | +* `identities_provider` - (Optional) Lookup users by external provider. (Requires administrator privileges) |
| 40 | + |
| 41 | +* `created_before` - (Optional) Search for users created before a specific date. (Requires administrator privileges) |
| 42 | + |
| 43 | +* `created_after` - (Optional) Search for users created after a specific date. (Requires administrator privileges) |
| 44 | + |
| 45 | + |
| 46 | +## Attributes Reference |
| 47 | + |
| 48 | +The following attributes are exported: |
| 49 | + |
| 50 | +* `users` - The list of users. |
| 51 | + * `id` - The unique id assigned to the user by the gitlab server. |
| 52 | + * `username` - The username of the user. |
| 53 | + * `email` - The e-mail address of the user. |
| 54 | + * `name` - The name of the user. |
| 55 | + * `is_admin` - Whether the user is an admin. |
| 56 | + * `can_create_group` - Whether the user can create groups. |
| 57 | + * `can_create_project` - Whether the user can create projects. |
| 58 | + * `projects_limit` - Number of projects the user can create. |
| 59 | + * `created_at` - Date the user was created at. |
| 60 | + * `state` - Whether the user is active or blocked. |
| 61 | + * `external` - Whether the user is external. |
| 62 | + * `extern_uid` - The external UID of the user. |
| 63 | + * `organization` - The organization of the user. |
| 64 | + * `two_factor_enabled` - Whether user's two factor auth is enabled. |
| 65 | + |
| 66 | + |
0 commit comments