The gitlab_user
data source allows details of a user to be retrieved by either the user ID, username or email address.
Upstream API: GitLab REST API docs
data "gitlab_user" "example" {
username = "myuser"
}
# Example using `for_each`
data "gitlab_user" "example-two" {
for_each = toset(["user1", "user2", "user3"])
username = each.value
}
email
(String) The public email address of the user. Note: before GitLab 14.8 the lookup was based on the users primary email address.namespace_id
(Number) The ID of the user's namespace. Requires admin token to access this field. Available since GitLab 14.10.user_id
(Number) The ID of the user.username
(String) The username of the user.avatar_url
(String) The avatar URL of the user.bio
(String) The bio of the user.can_create_group
(Boolean) Whether the user can create groups.can_create_project
(Boolean) Whether the user can create projects.color_scheme_id
(Number) User's color scheme ID.created_at
(String) Date the user was created at.current_sign_in_at
(String) Current user's sign-in date.extern_uid
(String) The external UID of the user.external
(Boolean) Whether the user is external.id
(String) The ID of this resource.is_admin
(Boolean) Whether the user is an admin.is_bot
(Boolean) Whether the user is a bot.last_sign_in_at
(String) Last user's sign-in date.linkedin
(String) LinkedIn profile of the user.location
(String) The location of the user.name
(String) The name of the user.note
(String) Admin notes for this user.organization
(String) The organization of the user.projects_limit
(Number) Number of projects the user can create.skype
(String) Skype username of the user.state
(String) Whether the user is active or blocked.theme_id
(Number) User's theme ID.twitter
(String) Twitter username of the user.two_factor_enabled
(Boolean) Whether user's two-factor auth is enabled.user_provider
(String) The UID provider of the user.website_url
(String) User's website URL.