GitLab v9.3.0 published on Monday, Sep 29, 2025 by Pulumi
gitlab.getCurrentUser
Start a Neo task
Explain and create a gitlab.getCurrentUser resource
The gitlab.getCurrentUser data source allows details of the current user (determined by token provider attribute) to be retrieved.
Upstream API: GitLab GraphQL API docs
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
const example = gitlab.getCurrentUser({});
import pulumi
import pulumi_gitlab as gitlab
example = gitlab.get_current_user()
package main
import (
"github.com/pulumi/pulumi-gitlab/sdk/v9/go/gitlab"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := gitlab.GetCurrentUser(ctx, map[string]interface{}{}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;
return await Deployment.RunAsync(() =>
{
var example = GitLab.GetCurrentUser.Invoke();
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.GitlabFunctions;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var example = GitlabFunctions.getCurrentUser(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference);
}
}
variables:
example:
fn::invoke:
function: gitlab:getCurrentUser
arguments: {}
Using getCurrentUser
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getCurrentUser(opts?: InvokeOptions): Promise<GetCurrentUserResult>
function getCurrentUserOutput(opts?: InvokeOptions): Output<GetCurrentUserResult>def get_current_user(opts: Optional[InvokeOptions] = None) -> GetCurrentUserResult
def get_current_user_output(opts: Optional[InvokeOptions] = None) -> Output[GetCurrentUserResult]func GetCurrentUser(ctx *Context, opts ...InvokeOption) (*GetCurrentUserResult, error)
func GetCurrentUserOutput(ctx *Context, opts ...InvokeOption) GetCurrentUserResultOutput> Note: This function is named GetCurrentUser in the Go SDK.
public static class GetCurrentUser
{
public static Task<GetCurrentUserResult> InvokeAsync(InvokeOptions? opts = null)
public static Output<GetCurrentUserResult> Invoke(InvokeOptions? opts = null)
}public static CompletableFuture<GetCurrentUserResult> getCurrentUser(InvokeOptions options)
public static Output<GetCurrentUserResult> getCurrentUser(InvokeOptions options)
fn::invoke:
function: gitlab:index/getCurrentUser:getCurrentUser
arguments:
# arguments dictionarygetCurrentUser Result
The following output properties are available:
- Bot bool
- Indicates if the user is a bot.
- Global
Id string - Global ID of the user. This is in the form of a GraphQL globally unique ID.
- Global
Namespace stringId - Personal namespace of the user. This is in the form of a GraphQL globally unique ID.
- Group
Count int - Group count for the user.
- Id string
- ID of the user.
- Name string
- Human-readable name of the user. Returns **** if the user is a project bot and the requester does not have permission to view the project.
- Namespace
Id string - Personal namespace of the user.
- Public
Email string - User's public email.
- Username string
- Username of the user. Unique within this instance of GitLab.
- Bot bool
- Indicates if the user is a bot.
- Global
Id string - Global ID of the user. This is in the form of a GraphQL globally unique ID.
- Global
Namespace stringId - Personal namespace of the user. This is in the form of a GraphQL globally unique ID.
- Group
Count int - Group count for the user.
- Id string
- ID of the user.
- Name string
- Human-readable name of the user. Returns **** if the user is a project bot and the requester does not have permission to view the project.
- Namespace
Id string - Personal namespace of the user.
- Public
Email string - User's public email.
- Username string
- Username of the user. Unique within this instance of GitLab.
- bot Boolean
- Indicates if the user is a bot.
- global
Id String - Global ID of the user. This is in the form of a GraphQL globally unique ID.
- global
Namespace StringId - Personal namespace of the user. This is in the form of a GraphQL globally unique ID.
- group
Count Integer - Group count for the user.
- id String
- ID of the user.
- name String
- Human-readable name of the user. Returns **** if the user is a project bot and the requester does not have permission to view the project.
- namespace
Id String - Personal namespace of the user.
- public
Email String - User's public email.
- username String
- Username of the user. Unique within this instance of GitLab.
- bot boolean
- Indicates if the user is a bot.
- global
Id string - Global ID of the user. This is in the form of a GraphQL globally unique ID.
- global
Namespace stringId - Personal namespace of the user. This is in the form of a GraphQL globally unique ID.
- group
Count number - Group count for the user.
- id string
- ID of the user.
- name string
- Human-readable name of the user. Returns **** if the user is a project bot and the requester does not have permission to view the project.
- namespace
Id string - Personal namespace of the user.
- public
Email string - User's public email.
- username string
- Username of the user. Unique within this instance of GitLab.
- bot bool
- Indicates if the user is a bot.
- global_
id str - Global ID of the user. This is in the form of a GraphQL globally unique ID.
- global_
namespace_ strid - Personal namespace of the user. This is in the form of a GraphQL globally unique ID.
- group_
count int - Group count for the user.
- id str
- ID of the user.
- name str
- Human-readable name of the user. Returns **** if the user is a project bot and the requester does not have permission to view the project.
- namespace_
id str - Personal namespace of the user.
- public_
email str - User's public email.
- username str
- Username of the user. Unique within this instance of GitLab.
- bot Boolean
- Indicates if the user is a bot.
- global
Id String - Global ID of the user. This is in the form of a GraphQL globally unique ID.
- global
Namespace StringId - Personal namespace of the user. This is in the form of a GraphQL globally unique ID.
- group
Count Number - Group count for the user.
- id String
- ID of the user.
- name String
- Human-readable name of the user. Returns **** if the user is a project bot and the requester does not have permission to view the project.
- namespace
Id String - Personal namespace of the user.
- public
Email String - User's public email.
- username String
- Username of the user. Unique within this instance of GitLab.
Package Details
- Repository
- GitLab pulumi/pulumi-gitlab
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
gitlabTerraform Provider.
