Skip to content

Request: Add outputs for username and email to the project/group access token resources

New Data Source / Resource

Problem

When creating a new gitlab_project_access_token or gitlab_group_access_token, you can only get the id of its bot user. There is no way to get the automatically generated email or username of that bot user. There is the gitlab_user data source, but it cannot get the email of a user if the GITLAB_TOKEN used by Terraform is not of an admin.

Proposal

Using the newly generated access token, you can call GET /user to get the the username and email of the current user. These values can be set as outputs: user_username and user_email

Related GitLab APIs

API documentation: https://docs.gitlab.com/ee/api/users.html#get-the-current-user

Additional Details

Edited by Pascal Roose