GitLab

v4.8.0 published on Friday, Jul 15, 2022 by Pulumi

getCurrentUser

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

using Pulumi;
using GitLab = Pulumi.GitLab;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(GitLab.GetCurrentUser.InvokeAsync());
    }

}
package main

import (
	"github.com/pulumi/pulumi-gitlab/sdk/v4/go/gitlab"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := gitlab.GetCurrentUser(ctx, nil, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var example = Output.of(GitlabFunctions.getCurrentUser());

    }
}
import pulumi
import pulumi_gitlab as gitlab

example = gitlab.get_current_user()
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";

const example = pulumi.output(gitlab.getCurrentUser());
variables:
  example:
    Fn::Invoke:
      Function: gitlab:getCurrentUser
      Arguments: {}

Using getCurrentUser

function getCurrentUser(opts?: InvokeOptions): Promise<GetCurrentUserResult>
def get_current_user(opts: Optional[InvokeOptions] = None) -> GetCurrentUserResult
func GetCurrentUser(ctx *Context, opts ...InvokeOption) (*GetCurrentUserResult, error)

> Note: This function is named GetCurrentUser in the Go SDK.

public static class GetCurrentUser 
{
    public static Task<GetCurrentUserResult> InvokeAsync(InvokeOptions? opts = null)
}
public static CompletableFuture<GetCurrentUserResult> getCurrentUser(InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: gitlab:index/getCurrentUser:getCurrentUser
  Arguments:
    # Arguments dictionary

getCurrentUser Result

The following output properties are available:

Bot bool
GlobalId string
GlobalNamespaceId string
GroupCount int
Id string
Name string
NamespaceId string
PublicEmail string
Username string
Bot bool
GlobalId string
GlobalNamespaceId string
GroupCount int
Id string
Name string
NamespaceId string
PublicEmail string
Username string
bot Boolean
globalId String
globalNamespaceId String
groupCount Integer
id String
name String
namespaceId String
publicEmail String
username String
bot boolean
globalId string
globalNamespaceId string
groupCount number
id string
name string
namespaceId string
publicEmail string
username string
bot Boolean
globalId String
globalNamespaceId String
groupCount Number
id String
name String
namespaceId String
publicEmail String
username String

Package Details

Repository
https://github.com/pulumi/pulumi-gitlab
License
Apache-2.0
Notes

This Pulumi package is based on the gitlab Terraform Provider.