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

gitlab.getGroups

Explore with Pulumi AI

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

The gitlab.getGroups data source allows details of multiple groups to be retrieved given some optional filter criteria.

Some attributes might not be returned depending on if you’re an admin or not.

Some available options require administrator privileges.

Upstream API: GitLab REST API docs

Example Usage

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

const example = gitlab.getGroups({
    sort: "desc",
    orderBy: "name",
});
const example_two = gitlab.getGroups({
    search: "GitLab",
});
Copy
import pulumi
import pulumi_gitlab as gitlab

example = gitlab.get_groups(sort="desc",
    order_by="name")
example_two = gitlab.get_groups(search="GitLab")
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.GetGroups(ctx, &gitlab.GetGroupsArgs{
			Sort:    pulumi.StringRef("desc"),
			OrderBy: pulumi.StringRef("name"),
		}, nil)
		if err != nil {
			return err
		}
		_, err = gitlab.GetGroups(ctx, &gitlab.GetGroupsArgs{
			Search: pulumi.StringRef("GitLab"),
		}, 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.GetGroups.Invoke(new()
    {
        Sort = "desc",
        OrderBy = "name",
    });

    var example_two = GitLab.GetGroups.Invoke(new()
    {
        Search = "GitLab",
    });

});
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.GetGroupsArgs;
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.getGroups(GetGroupsArgs.builder()
            .sort("desc")
            .orderBy("name")
            .build());

        final var example-two = GitlabFunctions.getGroups(GetGroupsArgs.builder()
            .search("GitLab")
            .build());

    }
}
Copy
variables:
  example:
    fn::invoke:
      function: gitlab:getGroups
      arguments:
        sort: desc
        orderBy: name
  example-two:
    fn::invoke:
      function: gitlab:getGroups
      arguments:
        search: GitLab
Copy

Using getGroups

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 getGroups(args: GetGroupsArgs, opts?: InvokeOptions): Promise<GetGroupsResult>
function getGroupsOutput(args: GetGroupsOutputArgs, opts?: InvokeOptions): Output<GetGroupsResult>
Copy
def get_groups(order_by: Optional[str] = None,
               search: Optional[str] = None,
               sort: Optional[str] = None,
               top_level_only: Optional[bool] = None,
               opts: Optional[InvokeOptions] = None) -> GetGroupsResult
def get_groups_output(order_by: Optional[pulumi.Input[str]] = None,
               search: Optional[pulumi.Input[str]] = None,
               sort: Optional[pulumi.Input[str]] = None,
               top_level_only: Optional[pulumi.Input[bool]] = None,
               opts: Optional[InvokeOptions] = None) -> Output[GetGroupsResult]
Copy
func GetGroups(ctx *Context, args *GetGroupsArgs, opts ...InvokeOption) (*GetGroupsResult, error)
func GetGroupsOutput(ctx *Context, args *GetGroupsOutputArgs, opts ...InvokeOption) GetGroupsResultOutput
Copy

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

public static class GetGroups 
{
    public static Task<GetGroupsResult> InvokeAsync(GetGroupsArgs args, InvokeOptions? opts = null)
    public static Output<GetGroupsResult> Invoke(GetGroupsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetGroupsResult> getGroups(GetGroupsArgs args, InvokeOptions options)
public static Output<GetGroupsResult> getGroups(GetGroupsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: gitlab:index/getGroups:getGroups
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

OrderBy string
Order the groups' list by id, name, path, or similarity. (Requires administrator privileges)
Search string
Search groups by name or path.
Sort string
Sort groups' list in asc or desc order. (Requires administrator privileges)
TopLevelOnly bool
Limit to top level groups, excluding all subgroups.
OrderBy string
Order the groups' list by id, name, path, or similarity. (Requires administrator privileges)
Search string
Search groups by name or path.
Sort string
Sort groups' list in asc or desc order. (Requires administrator privileges)
TopLevelOnly bool
Limit to top level groups, excluding all subgroups.
orderBy String
Order the groups' list by id, name, path, or similarity. (Requires administrator privileges)
search String
Search groups by name or path.
sort String
Sort groups' list in asc or desc order. (Requires administrator privileges)
topLevelOnly Boolean
Limit to top level groups, excluding all subgroups.
orderBy string
Order the groups' list by id, name, path, or similarity. (Requires administrator privileges)
search string
Search groups by name or path.
sort string
Sort groups' list in asc or desc order. (Requires administrator privileges)
topLevelOnly boolean
Limit to top level groups, excluding all subgroups.
order_by str
Order the groups' list by id, name, path, or similarity. (Requires administrator privileges)
search str
Search groups by name or path.
sort str
Sort groups' list in asc or desc order. (Requires administrator privileges)
top_level_only bool
Limit to top level groups, excluding all subgroups.
orderBy String
Order the groups' list by id, name, path, or similarity. (Requires administrator privileges)
search String
Search groups by name or path.
sort String
Sort groups' list in asc or desc order. (Requires administrator privileges)
topLevelOnly Boolean
Limit to top level groups, excluding all subgroups.

getGroups Result

The following output properties are available:

Groups List<Pulumi.GitLab.Outputs.GetGroupsGroup>
The list of groups.
Id string
The provider-assigned unique ID for this managed resource.
OrderBy string
Order the groups' list by id, name, path, or similarity. (Requires administrator privileges)
Search string
Search groups by name or path.
Sort string
Sort groups' list in asc or desc order. (Requires administrator privileges)
TopLevelOnly bool
Limit to top level groups, excluding all subgroups.
Groups []GetGroupsGroup
The list of groups.
Id string
The provider-assigned unique ID for this managed resource.
OrderBy string
Order the groups' list by id, name, path, or similarity. (Requires administrator privileges)
Search string
Search groups by name or path.
Sort string
Sort groups' list in asc or desc order. (Requires administrator privileges)
TopLevelOnly bool
Limit to top level groups, excluding all subgroups.
groups List<GetGroupsGroup>
The list of groups.
id String
The provider-assigned unique ID for this managed resource.
orderBy String
Order the groups' list by id, name, path, or similarity. (Requires administrator privileges)
search String
Search groups by name or path.
sort String
Sort groups' list in asc or desc order. (Requires administrator privileges)
topLevelOnly Boolean
Limit to top level groups, excluding all subgroups.
groups GetGroupsGroup[]
The list of groups.
id string
The provider-assigned unique ID for this managed resource.
orderBy string
Order the groups' list by id, name, path, or similarity. (Requires administrator privileges)
search string
Search groups by name or path.
sort string
Sort groups' list in asc or desc order. (Requires administrator privileges)
topLevelOnly boolean
Limit to top level groups, excluding all subgroups.
groups Sequence[GetGroupsGroup]
The list of groups.
id str
The provider-assigned unique ID for this managed resource.
order_by str
Order the groups' list by id, name, path, or similarity. (Requires administrator privileges)
search str
Search groups by name or path.
sort str
Sort groups' list in asc or desc order. (Requires administrator privileges)
top_level_only bool
Limit to top level groups, excluding all subgroups.
groups List<Property Map>
The list of groups.
id String
The provider-assigned unique ID for this managed resource.
orderBy String
Order the groups' list by id, name, path, or similarity. (Requires administrator privileges)
search String
Search groups by name or path.
sort String
Sort groups' list in asc or desc order. (Requires administrator privileges)
topLevelOnly Boolean
Limit to top level groups, excluding all subgroups.

Supporting Types

GetGroupsGroup

DefaultBranchProtection This property is required. int
Whether developers and maintainers can push to the applicable default branch.
Description This property is required. string
The description of the group.
FullName This property is required. string
The full name of the group.
FullPath This property is required. string
The full path of the group.
GroupId This property is required. int
The ID of the group.
LfsEnabled This property is required. bool
Boolean, is LFS enabled for projects in this group.
Name This property is required. string
The name of this group.
ParentId This property is required. int
Integer, ID of the parent group.
Path This property is required. string
The path of the group.
PreventForkingOutsideGroup This property is required. bool
When enabled, users can not fork projects from this group to external namespaces.
RequestAccessEnabled This property is required. bool
Boolean, is request for access enabled to the group.
RunnersToken This property is required. string
The group level registration token to use during runner setup.
SharedRunnersSetting This property is required. string
Enable or disable shared runners for a group’s subgroups and projects. Valid values are: enabled, disabled_and_overridable, disabled_and_unoverridable, disabled_with_override.
VisibilityLevel This property is required. string
Visibility level of the group. Possible values are private, internal, public.
WebUrl This property is required. string
Web URL of the group.
WikiAccessLevel This property is required. string
The group's wiki access level. Only available on Premium and Ultimate plans. Valid values are disabled, private, enabled.
DefaultBranchProtection This property is required. int
Whether developers and maintainers can push to the applicable default branch.
Description This property is required. string
The description of the group.
FullName This property is required. string
The full name of the group.
FullPath This property is required. string
The full path of the group.
GroupId This property is required. int
The ID of the group.
LfsEnabled This property is required. bool
Boolean, is LFS enabled for projects in this group.
Name This property is required. string
The name of this group.
ParentId This property is required. int
Integer, ID of the parent group.
Path This property is required. string
The path of the group.
PreventForkingOutsideGroup This property is required. bool
When enabled, users can not fork projects from this group to external namespaces.
RequestAccessEnabled This property is required. bool
Boolean, is request for access enabled to the group.
RunnersToken This property is required. string
The group level registration token to use during runner setup.
SharedRunnersSetting This property is required. string
Enable or disable shared runners for a group’s subgroups and projects. Valid values are: enabled, disabled_and_overridable, disabled_and_unoverridable, disabled_with_override.
VisibilityLevel This property is required. string
Visibility level of the group. Possible values are private, internal, public.
WebUrl This property is required. string
Web URL of the group.
WikiAccessLevel This property is required. string
The group's wiki access level. Only available on Premium and Ultimate plans. Valid values are disabled, private, enabled.
defaultBranchProtection This property is required. Integer
Whether developers and maintainers can push to the applicable default branch.
description This property is required. String
The description of the group.
fullName This property is required. String
The full name of the group.
fullPath This property is required. String
The full path of the group.
groupId This property is required. Integer
The ID of the group.
lfsEnabled This property is required. Boolean
Boolean, is LFS enabled for projects in this group.
name This property is required. String
The name of this group.
parentId This property is required. Integer
Integer, ID of the parent group.
path This property is required. String
The path of the group.
preventForkingOutsideGroup This property is required. Boolean
When enabled, users can not fork projects from this group to external namespaces.
requestAccessEnabled This property is required. Boolean
Boolean, is request for access enabled to the group.
runnersToken This property is required. String
The group level registration token to use during runner setup.
sharedRunnersSetting This property is required. String
Enable or disable shared runners for a group’s subgroups and projects. Valid values are: enabled, disabled_and_overridable, disabled_and_unoverridable, disabled_with_override.
visibilityLevel This property is required. String
Visibility level of the group. Possible values are private, internal, public.
webUrl This property is required. String
Web URL of the group.
wikiAccessLevel This property is required. String
The group's wiki access level. Only available on Premium and Ultimate plans. Valid values are disabled, private, enabled.
defaultBranchProtection This property is required. number
Whether developers and maintainers can push to the applicable default branch.
description This property is required. string
The description of the group.
fullName This property is required. string
The full name of the group.
fullPath This property is required. string
The full path of the group.
groupId This property is required. number
The ID of the group.
lfsEnabled This property is required. boolean
Boolean, is LFS enabled for projects in this group.
name This property is required. string
The name of this group.
parentId This property is required. number
Integer, ID of the parent group.
path This property is required. string
The path of the group.
preventForkingOutsideGroup This property is required. boolean
When enabled, users can not fork projects from this group to external namespaces.
requestAccessEnabled This property is required. boolean
Boolean, is request for access enabled to the group.
runnersToken This property is required. string
The group level registration token to use during runner setup.
sharedRunnersSetting This property is required. string
Enable or disable shared runners for a group’s subgroups and projects. Valid values are: enabled, disabled_and_overridable, disabled_and_unoverridable, disabled_with_override.
visibilityLevel This property is required. string
Visibility level of the group. Possible values are private, internal, public.
webUrl This property is required. string
Web URL of the group.
wikiAccessLevel This property is required. string
The group's wiki access level. Only available on Premium and Ultimate plans. Valid values are disabled, private, enabled.
default_branch_protection This property is required. int
Whether developers and maintainers can push to the applicable default branch.
description This property is required. str
The description of the group.
full_name This property is required. str
The full name of the group.
full_path This property is required. str
The full path of the group.
group_id This property is required. int
The ID of the group.
lfs_enabled This property is required. bool
Boolean, is LFS enabled for projects in this group.
name This property is required. str
The name of this group.
parent_id This property is required. int
Integer, ID of the parent group.
path This property is required. str
The path of the group.
prevent_forking_outside_group This property is required. bool
When enabled, users can not fork projects from this group to external namespaces.
request_access_enabled This property is required. bool
Boolean, is request for access enabled to the group.
runners_token This property is required. str
The group level registration token to use during runner setup.
shared_runners_setting This property is required. str
Enable or disable shared runners for a group’s subgroups and projects. Valid values are: enabled, disabled_and_overridable, disabled_and_unoverridable, disabled_with_override.
visibility_level This property is required. str
Visibility level of the group. Possible values are private, internal, public.
web_url This property is required. str
Web URL of the group.
wiki_access_level This property is required. str
The group's wiki access level. Only available on Premium and Ultimate plans. Valid values are disabled, private, enabled.
defaultBranchProtection This property is required. Number
Whether developers and maintainers can push to the applicable default branch.
description This property is required. String
The description of the group.
fullName This property is required. String
The full name of the group.
fullPath This property is required. String
The full path of the group.
groupId This property is required. Number
The ID of the group.
lfsEnabled This property is required. Boolean
Boolean, is LFS enabled for projects in this group.
name This property is required. String
The name of this group.
parentId This property is required. Number
Integer, ID of the parent group.
path This property is required. String
The path of the group.
preventForkingOutsideGroup This property is required. Boolean
When enabled, users can not fork projects from this group to external namespaces.
requestAccessEnabled This property is required. Boolean
Boolean, is request for access enabled to the group.
runnersToken This property is required. String
The group level registration token to use during runner setup.
sharedRunnersSetting This property is required. String
Enable or disable shared runners for a group’s subgroups and projects. Valid values are: enabled, disabled_and_overridable, disabled_and_unoverridable, disabled_with_override.
visibilityLevel This property is required. String
Visibility level of the group. Possible values are private, internal, public.
webUrl This property is required. String
Web URL of the group.
wikiAccessLevel This property is required. String
The group's wiki access level. Only available on Premium and Ultimate plans. Valid values are disabled, private, enabled.

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