1. Packages
  2. Gitlab Provider
  3. API Docs
  4. getInstanceServiceAccount
GitLab v8.10.0 published on Friday, Mar 21, 2025 by Pulumi

gitlab.getInstanceServiceAccount

Explore with Pulumi AI

The gitlab.InstanceServiceAccount data source retrieves information about a gitlab service account.

In order for a user to create a user account, they must have admin privileges at the instance level. This makes this feature unavailable on gitlab.com

Upstream API: GitLab REST API docs

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";

const example = gitlab.getInstanceServiceAccount({
    serviceAccountId: "123",
});
Copy
import pulumi
import pulumi_gitlab as gitlab

example = gitlab.get_instance_service_account(service_account_id="123")
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := gitlab.LookupInstanceServiceAccount(ctx, &gitlab.LookupInstanceServiceAccountArgs{
			ServiceAccountId: "123",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;

return await Deployment.RunAsync(() => 
{
    var example = GitLab.GetInstanceServiceAccount.Invoke(new()
    {
        ServiceAccountId = "123",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.GitlabFunctions;
import com.pulumi.gitlab.inputs.GetInstanceServiceAccountArgs;
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.getInstanceServiceAccount(GetInstanceServiceAccountArgs.builder()
            .serviceAccountId("123")
            .build());

    }
}
Copy
variables:
  example:
    fn::invoke:
      function: gitlab:getInstanceServiceAccount
      arguments:
        serviceAccountId: '123'
Copy

Using getInstanceServiceAccount

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 getInstanceServiceAccount(args: GetInstanceServiceAccountArgs, opts?: InvokeOptions): Promise<GetInstanceServiceAccountResult>
function getInstanceServiceAccountOutput(args: GetInstanceServiceAccountOutputArgs, opts?: InvokeOptions): Output<GetInstanceServiceAccountResult>
Copy
def get_instance_service_account(service_account_id: Optional[str] = None,
                                 opts: Optional[InvokeOptions] = None) -> GetInstanceServiceAccountResult
def get_instance_service_account_output(service_account_id: Optional[pulumi.Input[str]] = None,
                                 opts: Optional[InvokeOptions] = None) -> Output[GetInstanceServiceAccountResult]
Copy
func LookupInstanceServiceAccount(ctx *Context, args *LookupInstanceServiceAccountArgs, opts ...InvokeOption) (*LookupInstanceServiceAccountResult, error)
func LookupInstanceServiceAccountOutput(ctx *Context, args *LookupInstanceServiceAccountOutputArgs, opts ...InvokeOption) LookupInstanceServiceAccountResultOutput
Copy

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

public static class GetInstanceServiceAccount 
{
    public static Task<GetInstanceServiceAccountResult> InvokeAsync(GetInstanceServiceAccountArgs args, InvokeOptions? opts = null)
    public static Output<GetInstanceServiceAccountResult> Invoke(GetInstanceServiceAccountInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetInstanceServiceAccountResult> getInstanceServiceAccount(GetInstanceServiceAccountArgs args, InvokeOptions options)
public static Output<GetInstanceServiceAccountResult> getInstanceServiceAccount(GetInstanceServiceAccountArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: gitlab:index/getInstanceServiceAccount:getInstanceServiceAccount
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

ServiceAccountId This property is required. string
The service account id.
ServiceAccountId This property is required. string
The service account id.
serviceAccountId This property is required. String
The service account id.
serviceAccountId This property is required. string
The service account id.
service_account_id This property is required. str
The service account id.
serviceAccountId This property is required. String
The service account id.

getInstanceServiceAccount Result

The following output properties are available:

Id string
Name string
The name of the user.
ServiceAccountId string
The service account id.
Username string
The username of the user.
Id string
Name string
The name of the user.
ServiceAccountId string
The service account id.
Username string
The username of the user.
id String
name String
The name of the user.
serviceAccountId String
The service account id.
username String
The username of the user.
id string
name string
The name of the user.
serviceAccountId string
The service account id.
username string
The username of the user.
id str
name str
The name of the user.
service_account_id str
The service account id.
username str
The username of the user.
id String
name String
The name of the user.
serviceAccountId String
The service account id.
username String
The username of the user.

Package Details

Repository
GitLab pulumi/pulumi-gitlab
License
Apache-2.0
Notes
This Pulumi package is based on the gitlab Terraform Provider.