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

gitlab.getGroupIds

Explore with Pulumi AI

GitLab v8.10.0 published on Friday, Mar 21, 2025 by Pulumi

The gitlab.getGroupIds data source identification information for a given group, allowing a user to translate a full path or ID into the GraphQL ID of the group.

Upstream API: GitLab GraphQL API docs

Example Usage

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

const newGroup = new gitlab.Group("new_group", {});
// use group IDs to get additional information, such as the GraphQL ID
// for other resources
const foo = gitlab.getGroupIds({
    group: "gitlab_group.new_group.id",
});
export const graphQLId = foo.then(foo => foo.groupGraphqlId);
Copy
import pulumi
import pulumi_gitlab as gitlab

new_group = gitlab.Group("new_group")
# use group IDs to get additional information, such as the GraphQL ID
# for other resources
foo = gitlab.get_group_ids(group="gitlab_group.new_group.id")
pulumi.export("graphQLId", foo.group_graphql_id)
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.NewGroup(ctx, "new_group", nil)
		if err != nil {
			return err
		}
		// use group IDs to get additional information, such as the GraphQL ID
		// for other resources
		foo, err := gitlab.GetGroupIds(ctx, &gitlab.GetGroupIdsArgs{
			Group: "gitlab_group.new_group.id",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("graphQLId", foo.GroupGraphqlId)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;

return await Deployment.RunAsync(() => 
{
    var newGroup = new GitLab.Group("new_group");

    // use group IDs to get additional information, such as the GraphQL ID
    // for other resources
    var foo = GitLab.GetGroupIds.Invoke(new()
    {
        Group = "gitlab_group.new_group.id",
    });

    return new Dictionary<string, object?>
    {
        ["graphQLId"] = foo.Apply(getGroupIdsResult => getGroupIdsResult.GroupGraphqlId),
    };
});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.Group;
import com.pulumi.gitlab.GitlabFunctions;
import com.pulumi.gitlab.inputs.GetGroupIdsArgs;
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) {
        var newGroup = new Group("newGroup");

        // use group IDs to get additional information, such as the GraphQL ID
        // for other resources
        final var foo = GitlabFunctions.getGroupIds(GetGroupIdsArgs.builder()
            .group("gitlab_group.new_group.id")
            .build());

        ctx.export("graphQLId", foo.applyValue(getGroupIdsResult -> getGroupIdsResult.groupGraphqlId()));
    }
}
Copy
resources:
  newGroup:
    type: gitlab:Group
    name: new_group
variables:
  # use group IDs to get additional information, such as the GraphQL ID
  # // for other resources
  foo:
    fn::invoke:
      function: gitlab:getGroupIds
      arguments:
        group: gitlab_group.new_group.id
outputs:
  graphQLId: ${foo.groupGraphqlId}
Copy

Using getGroupIds

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 getGroupIds(args: GetGroupIdsArgs, opts?: InvokeOptions): Promise<GetGroupIdsResult>
function getGroupIdsOutput(args: GetGroupIdsOutputArgs, opts?: InvokeOptions): Output<GetGroupIdsResult>
Copy
def get_group_ids(group: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetGroupIdsResult
def get_group_ids_output(group: Optional[pulumi.Input[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetGroupIdsResult]
Copy
func GetGroupIds(ctx *Context, args *GetGroupIdsArgs, opts ...InvokeOption) (*GetGroupIdsResult, error)
func GetGroupIdsOutput(ctx *Context, args *GetGroupIdsOutputArgs, opts ...InvokeOption) GetGroupIdsResultOutput
Copy

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

public static class GetGroupIds 
{
    public static Task<GetGroupIdsResult> InvokeAsync(GetGroupIdsArgs args, InvokeOptions? opts = null)
    public static Output<GetGroupIdsResult> Invoke(GetGroupIdsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetGroupIdsResult> getGroupIds(GetGroupIdsArgs args, InvokeOptions options)
public static Output<GetGroupIdsResult> getGroupIds(GetGroupIdsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: gitlab:index/getGroupIds:getGroupIds
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Group This property is required. string
The ID or URL-encoded path of the group.
Group This property is required. string
The ID or URL-encoded path of the group.
group This property is required. String
The ID or URL-encoded path of the group.
group This property is required. string
The ID or URL-encoded path of the group.
group This property is required. str
The ID or URL-encoded path of the group.
group This property is required. String
The ID or URL-encoded path of the group.

getGroupIds Result

The following output properties are available:

Group string
The ID or URL-encoded path of the group.
GroupFullPath string
The full path of the group.
GroupGraphqlId string
The GraphQL ID of the group.
GroupId string
The ID of the group.
Id string
Group string
The ID or URL-encoded path of the group.
GroupFullPath string
The full path of the group.
GroupGraphqlId string
The GraphQL ID of the group.
GroupId string
The ID of the group.
Id string
group String
The ID or URL-encoded path of the group.
groupFullPath String
The full path of the group.
groupGraphqlId String
The GraphQL ID of the group.
groupId String
The ID of the group.
id String
group string
The ID or URL-encoded path of the group.
groupFullPath string
The full path of the group.
groupGraphqlId string
The GraphQL ID of the group.
groupId string
The ID of the group.
id string
group str
The ID or URL-encoded path of the group.
group_full_path str
The full path of the group.
group_graphql_id str
The GraphQL ID of the group.
group_id str
The ID of the group.
id str
group String
The ID or URL-encoded path of the group.
groupFullPath String
The full path of the group.
groupGraphqlId String
The GraphQL ID of the group.
groupId String
The ID of the group.
id String

Package Details

Repository
GitLab pulumi/pulumi-gitlab
License
Apache-2.0
Notes
This Pulumi package is based on the gitlab Terraform Provider.
GitLab v8.10.0 published on Friday, Mar 21, 2025 by Pulumi