getProjects

# gitlab_projects

Provides details about a list of projects in the Gitlab provider. Listing all projects and group projects with project filtering or group project filtering is supported.

NOTE: This data source supports all available filters exposed by the xanzy/go-gitlab package, which might not expose all available filters exposed by the Gitlab APIs.

Example Usage

List projects within a group tree

using Pulumi;
using GitLab = Pulumi.GitLab;

class MyStack : Stack
{
    public MyStack()
    {
        var mygroup = Output.Create(GitLab.GetGroup.InvokeAsync(new GitLab.GetGroupArgs
        {
            FullPath = "mygroup",
        }));
        var groupProjects = mygroup.Apply(mygroup => Output.Create(GitLab.GetProjects.InvokeAsync(new GitLab.GetProjectsArgs
        {
            GroupId = mygroup.Id,
            OrderBy = "name",
            IncludeSubgroups = true,
            WithShared = false,
        })));
    }

}
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 {
		opt0 := "mygroup"
		mygroup, err := gitlab.LookupGroup(ctx, &gitlab.LookupGroupArgs{
			FullPath: &opt0,
		}, nil)
		if err != nil {
			return err
		}
		opt1 := mygroup.Id
		opt2 := "name"
		opt3 := true
		opt4 := false
		_, err = gitlab.GetProjects(ctx, &gitlab.GetProjectsArgs{
			GroupId:          &opt1,
			OrderBy:          &opt2,
			IncludeSubgroups: &opt3,
			WithShared:       &opt4,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_gitlab as gitlab

mygroup = gitlab.get_group(full_path="mygroup")
group_projects = gitlab.get_projects(group_id=mygroup.id,
    order_by="name",
    include_subgroups=True,
    with_shared=False)
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";

const mygroup = gitlab.getGroup({
    fullPath: "mygroup",
});
const groupProjects = mygroup.then(mygroup => gitlab.getProjects({
    groupId: mygroup.id,
    orderBy: "name",
    includeSubgroups: true,
    withShared: false,
}));

List projects using the search syntax

using Pulumi;
using GitLab = Pulumi.GitLab;

class MyStack : Stack
{
    public MyStack()
    {
        var projects = Output.Create(GitLab.GetProjects.InvokeAsync(new GitLab.GetProjectsArgs
        {
            Search = "postgresql",
            Visibility = "private",
        }));
    }

}
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 {
		opt0 := "postgresql"
		opt1 := "private"
		_, err := gitlab.GetProjects(ctx, &gitlab.GetProjectsArgs{
			Search:     &opt0,
			Visibility: &opt1,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_gitlab as gitlab

projects = gitlab.get_projects(search="postgresql",
    visibility="private")
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";

const projects = pulumi.output(gitlab.getProjects({
    search: "postgresql",
    visibility: "private",
}, { async: true }));

Using getProjects

function getProjects(args: GetProjectsArgs, opts?: InvokeOptions): Promise<GetProjectsResult>
def get_projects(archived: Optional[bool] = None,
                 group_id: Optional[int] = None,
                 include_subgroups: Optional[bool] = None,
                 max_queryable_pages: Optional[int] = None,
                 membership: Optional[bool] = None,
                 min_access_level: Optional[int] = None,
                 order_by: Optional[str] = None,
                 owned: Optional[bool] = None,
                 page: Optional[int] = None,
                 per_page: Optional[int] = None,
                 search: Optional[str] = None,
                 simple: Optional[bool] = None,
                 sort: Optional[str] = None,
                 starred: Optional[bool] = None,
                 statistics: Optional[bool] = None,
                 visibility: Optional[str] = None,
                 with_custom_attributes: Optional[bool] = None,
                 with_issues_enabled: Optional[bool] = None,
                 with_merge_requests_enabled: Optional[bool] = None,
                 with_programming_language: Optional[str] = None,
                 with_shared: Optional[bool] = None,
                 opts: Optional[InvokeOptions] = None) -> GetProjectsResult
func GetProjects(ctx *Context, args *GetProjectsArgs, opts ...InvokeOption) (*GetProjectsResult, error)

Note: This function is named GetProjects in the Go SDK.

public static class GetProjects {
    public static Task<GetProjectsResult> InvokeAsync(GetProjectsArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Archived bool
Limit by archived status.
GroupId int
The ID of the group owned by the authenticated user to look projects for within. Cannot be used with min_access_level, with_programming_language or statistics.
IncludeSubgroups bool
Include projects in subgroups of this group. Default is false. Needs group_id.
MaxQueryablePages int
Prevents overloading your Gitlab instance in case of a misconfiguration. Default is 10.
Membership bool
Limit by projects that the current user is a member of.
MinAccessLevel int
Limit to projects where current user has at least this access level, refer to the official documentation for values. Cannot be used with group_id.
OrderBy string
Return projects ordered by id, name, path, created_at, updated_at, or last_activity_at fields. Default is created_at.
Owned bool
Limit by projects owned by the current user.
Page int
PerPage int
Search string
Return list of authorized projects matching the search criteria.
Simple bool
Return only the ID, URL, name, and path of each project.
Sort string
Return projects sorted in asc or desc order. Default is desc.
Starred bool
Limit by projects starred by the current user.
Statistics bool
Include project statistics. Cannot be used with group_id.
Visibility string
Limit by visibility public, internal, or private.
WithCustomAttributes bool
Include custom attributes in response (admins only).
WithIssuesEnabled bool
Limit by projects with issues feature enabled. Default is false.
WithMergeRequestsEnabled bool
Limit by projects with merge requests feature enabled. Default is false.
WithProgrammingLanguage string
Limit by projects which use the given programming language. Cannot be used with group_id.
WithShared bool
Include projects shared to this group. Default is true. Needs group_id.
Archived bool
Limit by archived status.
GroupId int
The ID of the group owned by the authenticated user to look projects for within. Cannot be used with min_access_level, with_programming_language or statistics.
IncludeSubgroups bool
Include projects in subgroups of this group. Default is false. Needs group_id.
MaxQueryablePages int
Prevents overloading your Gitlab instance in case of a misconfiguration. Default is 10.
Membership bool
Limit by projects that the current user is a member of.
MinAccessLevel int
Limit to projects where current user has at least this access level, refer to the official documentation for values. Cannot be used with group_id.
OrderBy string
Return projects ordered by id, name, path, created_at, updated_at, or last_activity_at fields. Default is created_at.
Owned bool
Limit by projects owned by the current user.
Page int
PerPage int
Search string
Return list of authorized projects matching the search criteria.
Simple bool
Return only the ID, URL, name, and path of each project.
Sort string
Return projects sorted in asc or desc order. Default is desc.
Starred bool
Limit by projects starred by the current user.
Statistics bool
Include project statistics. Cannot be used with group_id.
Visibility string
Limit by visibility public, internal, or private.
WithCustomAttributes bool
Include custom attributes in response (admins only).
WithIssuesEnabled bool
Limit by projects with issues feature enabled. Default is false.
WithMergeRequestsEnabled bool
Limit by projects with merge requests feature enabled. Default is false.
WithProgrammingLanguage string
Limit by projects which use the given programming language. Cannot be used with group_id.
WithShared bool
Include projects shared to this group. Default is true. Needs group_id.
archived boolean
Limit by archived status.
groupId number
The ID of the group owned by the authenticated user to look projects for within. Cannot be used with min_access_level, with_programming_language or statistics.
includeSubgroups boolean
Include projects in subgroups of this group. Default is false. Needs group_id.
maxQueryablePages number
Prevents overloading your Gitlab instance in case of a misconfiguration. Default is 10.
membership boolean
Limit by projects that the current user is a member of.
minAccessLevel number
Limit to projects where current user has at least this access level, refer to the official documentation for values. Cannot be used with group_id.
orderBy string
Return projects ordered by id, name, path, created_at, updated_at, or last_activity_at fields. Default is created_at.
owned boolean
Limit by projects owned by the current user.
page number
perPage number
search string
Return list of authorized projects matching the search criteria.
simple boolean
Return only the ID, URL, name, and path of each project.
sort string
Return projects sorted in asc or desc order. Default is desc.
starred boolean
Limit by projects starred by the current user.
statistics boolean
Include project statistics. Cannot be used with group_id.
visibility string
Limit by visibility public, internal, or private.
withCustomAttributes boolean
Include custom attributes in response (admins only).
withIssuesEnabled boolean
Limit by projects with issues feature enabled. Default is false.
withMergeRequestsEnabled boolean
Limit by projects with merge requests feature enabled. Default is false.
withProgrammingLanguage string
Limit by projects which use the given programming language. Cannot be used with group_id.
withShared boolean
Include projects shared to this group. Default is true. Needs group_id.
archived bool
Limit by archived status.
group_id int
The ID of the group owned by the authenticated user to look projects for within. Cannot be used with min_access_level, with_programming_language or statistics.
include_subgroups bool
Include projects in subgroups of this group. Default is false. Needs group_id.
max_queryable_pages int
Prevents overloading your Gitlab instance in case of a misconfiguration. Default is 10.
membership bool
Limit by projects that the current user is a member of.
min_access_level int
Limit to projects where current user has at least this access level, refer to the official documentation for values. Cannot be used with group_id.
order_by str
Return projects ordered by id, name, path, created_at, updated_at, or last_activity_at fields. Default is created_at.
owned bool
Limit by projects owned by the current user.
page int
per_page int
search str
Return list of authorized projects matching the search criteria.
simple bool
Return only the ID, URL, name, and path of each project.
sort str
Return projects sorted in asc or desc order. Default is desc.
starred bool
Limit by projects starred by the current user.
statistics bool
Include project statistics. Cannot be used with group_id.
visibility str
Limit by visibility public, internal, or private.
with_custom_attributes bool
Include custom attributes in response (admins only).
with_issues_enabled bool
Limit by projects with issues feature enabled. Default is false.
with_merge_requests_enabled bool
Limit by projects with merge requests feature enabled. Default is false.
with_programming_language str
Limit by projects which use the given programming language. Cannot be used with group_id.
with_shared bool
Include projects shared to this group. Default is true. Needs group_id.

getProjects Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Projects List<Pulumi.GitLab.Outputs.GetProjectsProject>
A list containing the projects matching the supplied arguments
Archived bool
GroupId int
IncludeSubgroups bool
MaxQueryablePages int
Membership bool
MinAccessLevel int
OrderBy string
Owned bool
Page int
PerPage int
Search string
Simple bool
Sort string
Starred bool
Statistics bool
Visibility string
The visibility of the project.
WithCustomAttributes bool
WithIssuesEnabled bool
WithMergeRequestsEnabled bool
WithProgrammingLanguage string
WithShared bool
Id string
The provider-assigned unique ID for this managed resource.
Projects []GetProjectsProject
A list containing the projects matching the supplied arguments
Archived bool
GroupId int
IncludeSubgroups bool
MaxQueryablePages int
Membership bool
MinAccessLevel int
OrderBy string
Owned bool
Page int
PerPage int
Search string
Simple bool
Sort string
Starred bool
Statistics bool
Visibility string
The visibility of the project.
WithCustomAttributes bool
WithIssuesEnabled bool
WithMergeRequestsEnabled bool
WithProgrammingLanguage string
WithShared bool
id string
The provider-assigned unique ID for this managed resource.
projects GetProjectsProject[]
A list containing the projects matching the supplied arguments
archived boolean
groupId number
includeSubgroups boolean
maxQueryablePages number
membership boolean
minAccessLevel number
orderBy string
owned boolean
page number
perPage number
search string
simple boolean
sort string
starred boolean
statistics boolean
visibility string
The visibility of the project.
withCustomAttributes boolean
withIssuesEnabled boolean
withMergeRequestsEnabled boolean
withProgrammingLanguage string
withShared boolean
id str
The provider-assigned unique ID for this managed resource.
projects Sequence[GetProjectsProject]
A list containing the projects matching the supplied arguments
archived bool
group_id int
include_subgroups bool
max_queryable_pages int
membership bool
min_access_level int
order_by str
owned bool
page int
per_page int
search str
simple bool
sort str
starred bool
statistics bool
visibility str
The visibility of the project.
with_custom_attributes bool
with_issues_enabled bool
with_merge_requests_enabled bool
with_programming_language str
with_shared bool

Supporting Types

GetProjectsProject

ApprovalsBeforeMerge int
The numbers of approvals needed in a merge requests.
Archived bool
Limit by archived status.
AvatarUrl string
CiConfigPath string
ContainerRegistryEnabled bool
CreatedAt string
CreatorId int
CustomAttributes List<ImmutableDictionary<string, object>>
DefaultBranch string
Description string
ForkedFromProject Pulumi.GitLab.Inputs.GetProjectsProjectForkedFromProject
ForksCount int
HttpUrlToRepo string
The HTTP clone URL of the project.
Id int
The ID of the project.
ImportError string
ImportStatus string
IssuesEnabled bool
JobsEnabled bool
Whether pipelines are enabled for the project.
LastActivityAt string
LfsEnabled bool
MergeMethod string
MergeRequestsEnabled bool
Mirror bool
MirrorOverwritesDivergedBranches bool
MirrorTriggerBuilds bool
MirrorUserId int
Name string
The name of the project.
NameWithNamespace string
In group / subgroup / project or user / project format.
Namespace Pulumi.GitLab.Inputs.GetProjectsProjectNamespace
OnlyAllowMergeIfAllDiscussionsAreResolved bool
OnlyAllowMergeIfPipelineSucceeds bool
OnlyMirrorProtectedBranches bool
OpenIssuesCount int
Owner Pulumi.GitLab.Inputs.GetProjectsProjectOwner
PackagesEnabled bool
Path string
PathWithNamespace string
In group/subgroup/project or user/project format.
Permissions Pulumi.GitLab.Inputs.GetProjectsProjectPermissions
Public bool
Whether the project is public.
PublicBuilds bool
ReadmeUrl string
RequestAccessEnabled bool
ResolveOutdatedDiffDiscussions bool
RunnersToken string
SharedRunnersEnabled bool
SharedWithGroups List<Pulumi.GitLab.Inputs.GetProjectsProjectSharedWithGroup>
SnippetsEnabled bool
SshUrlToRepo string
The SSH clone URL of the project.
StarCount int
Statistics Dictionary<string, int>
Include project statistics. Cannot be used with group_id.
TagLists List<string>
A set of the project topics (formerly called “project tags”).
Visibility string
Limit by visibility public, internal, or private.
WebUrl string
WikiEnabled bool
_links Dictionary<string, string>
ApprovalsBeforeMerge int
The numbers of approvals needed in a merge requests.
Archived bool
Limit by archived status.
AvatarUrl string
CiConfigPath string
ContainerRegistryEnabled bool
CreatedAt string
CreatorId int
CustomAttributes []map[string]interface{}
DefaultBranch string
Description string
ForkedFromProject GetProjectsProjectForkedFromProject
ForksCount int
HttpUrlToRepo string
The HTTP clone URL of the project.
Id int
The ID of the project.
ImportError string
ImportStatus string
IssuesEnabled bool
JobsEnabled bool
Whether pipelines are enabled for the project.
LastActivityAt string
LfsEnabled bool
MergeMethod string
MergeRequestsEnabled bool
Mirror bool
MirrorOverwritesDivergedBranches bool
MirrorTriggerBuilds bool
MirrorUserId int
Name string
The name of the project.
NameWithNamespace string
In group / subgroup / project or user / project format.
Namespace GetProjectsProjectNamespace
OnlyAllowMergeIfAllDiscussionsAreResolved bool
OnlyAllowMergeIfPipelineSucceeds bool
OnlyMirrorProtectedBranches bool
OpenIssuesCount int
Owner GetProjectsProjectOwner
PackagesEnabled bool
Path string
PathWithNamespace string
In group/subgroup/project or user/project format.
Permissions GetProjectsProjectPermissions
Public bool
Whether the project is public.
PublicBuilds bool
ReadmeUrl string
RequestAccessEnabled bool
ResolveOutdatedDiffDiscussions bool
RunnersToken string
SharedRunnersEnabled bool
SharedWithGroups []GetProjectsProjectSharedWithGroup
SnippetsEnabled bool
SshUrlToRepo string
The SSH clone URL of the project.
StarCount int
Statistics map[string]int
Include project statistics. Cannot be used with group_id.
TagLists []string
A set of the project topics (formerly called “project tags”).
Visibility string
Limit by visibility public, internal, or private.
WebUrl string
WikiEnabled bool
_links map[string]string
_links {[key: string]: string}
approvalsBeforeMerge number
The numbers of approvals needed in a merge requests.
archived boolean
Limit by archived status.
avatarUrl string
ciConfigPath string
containerRegistryEnabled boolean
createdAt string
creatorId number
customAttributes {[key: string]: any}[]
defaultBranch string
description string
forkedFromProject GetProjectsProjectForkedFromProject
forksCount number
httpUrlToRepo string
The HTTP clone URL of the project.
id number
The ID of the project.
importError string
importStatus string
issuesEnabled boolean
jobsEnabled boolean
Whether pipelines are enabled for the project.
lastActivityAt string
lfsEnabled boolean
mergeMethod string
mergeRequestsEnabled boolean
mirror boolean
mirrorOverwritesDivergedBranches boolean
mirrorTriggerBuilds boolean
mirrorUserId number
name string
The name of the project.
nameWithNamespace string
In group / subgroup / project or user / project format.
namespace GetProjectsProjectNamespace
onlyAllowMergeIfAllDiscussionsAreResolved boolean
onlyAllowMergeIfPipelineSucceeds boolean
onlyMirrorProtectedBranches boolean
openIssuesCount number
owner GetProjectsProjectOwner
packagesEnabled boolean
path string
pathWithNamespace string
In group/subgroup/project or user/project format.
permissions GetProjectsProjectPermissions
public boolean
Whether the project is public.
publicBuilds boolean
readmeUrl string
requestAccessEnabled boolean
resolveOutdatedDiffDiscussions boolean
runnersToken string
sharedRunnersEnabled boolean
sharedWithGroups GetProjectsProjectSharedWithGroup[]
snippetsEnabled boolean
sshUrlToRepo string
The SSH clone URL of the project.
starCount number
statistics {[key: string]: number}
Include project statistics. Cannot be used with group_id.
tagLists string[]
A set of the project topics (formerly called “project tags”).
visibility string
Limit by visibility public, internal, or private.
webUrl string
wikiEnabled boolean
_links Mapping[str, str]
approvals_before_merge int
The numbers of approvals needed in a merge requests.
archived bool
Limit by archived status.
avatar_url str
ci_config_path str
container_registry_enabled bool
created_at str
creator_id int
custom_attributes Sequence[Mapping[str, Any]]
default_branch str
description str
forked_from_project GetProjectsProjectForkedFromProject
forks_count int
http_url_to_repo str
The HTTP clone URL of the project.
id int
The ID of the project.
import_error str
import_status str
issues_enabled bool
jobs_enabled bool
Whether pipelines are enabled for the project.
last_activity_at str
lfs_enabled bool
merge_method str
merge_requests_enabled bool
mirror bool
mirror_overwrites_diverged_branches bool
mirror_trigger_builds bool
mirror_user_id int
name str
The name of the project.
name_with_namespace str
In group / subgroup / project or user / project format.
namespace GetProjectsProjectNamespace
only_allow_merge_if_all_discussions_are_resolved bool
only_allow_merge_if_pipeline_succeeds bool
only_mirror_protected_branches bool
open_issues_count int
owner GetProjectsProjectOwner
packages_enabled bool
path str
path_with_namespace str
In group/subgroup/project or user/project format.
permissions GetProjectsProjectPermissions
public bool
Whether the project is public.
public_builds bool
readme_url str
request_access_enabled bool
resolve_outdated_diff_discussions bool
runners_token str
shared_runners_enabled bool
shared_with_groups Sequence[GetProjectsProjectSharedWithGroup]
snippets_enabled bool
ssh_url_to_repo str
The SSH clone URL of the project.
star_count int
statistics Mapping[str, int]
Include project statistics. Cannot be used with group_id.
tag_lists Sequence[str]
A set of the project topics (formerly called “project tags”).
visibility str
Limit by visibility public, internal, or private.
web_url str
wiki_enabled bool

GetProjectsProjectForkedFromProject

HttpUrlToRepo string
The HTTP clone URL of the project.
Id int
The ID of the project.
Name string
The name of the project.
NameWithNamespace string
In group / subgroup / project or user / project format.
Path string
PathWithNamespace string
In group/subgroup/project or user/project format.
WebUrl string
HttpUrlToRepo string
The HTTP clone URL of the project.
Id int
The ID of the project.
Name string
The name of the project.
NameWithNamespace string
In group / subgroup / project or user / project format.
Path string
PathWithNamespace string
In group/subgroup/project or user/project format.
WebUrl string
httpUrlToRepo string
The HTTP clone URL of the project.
id number
The ID of the project.
name string
The name of the project.
nameWithNamespace string
In group / subgroup / project or user / project format.
path string
pathWithNamespace string
In group/subgroup/project or user/project format.
webUrl string
http_url_to_repo str
The HTTP clone URL of the project.
id int
The ID of the project.
name str
The name of the project.
name_with_namespace str
In group / subgroup / project or user / project format.
path str
path_with_namespace str
In group/subgroup/project or user/project format.
web_url str

GetProjectsProjectNamespace

FullPath string
Id int
The ID of the project.
Kind string
Name string
The name of the project.
Path string
FullPath string
Id int
The ID of the project.
Kind string
Name string
The name of the project.
Path string
fullPath string
id number
The ID of the project.
kind string
name string
The name of the project.
path string
full_path str
id int
The ID of the project.
kind str
name str
The name of the project.
path str

GetProjectsProjectOwner

AvatarUrl string
Id int
The ID of the project.
Name string
The name of the project.
State string
Username string
WebsiteUrl string
AvatarUrl string
Id int
The ID of the project.
Name string
The name of the project.
State string
Username string
WebsiteUrl string
avatarUrl string
id number
The ID of the project.
name string
The name of the project.
state string
username string
websiteUrl string
avatar_url str
id int
The ID of the project.
name str
The name of the project.
state str
username str
website_url str

GetProjectsProjectPermissions

GroupAccess Dictionary<string, int>
ProjectAccess Dictionary<string, int>
GroupAccess map[string]int
ProjectAccess map[string]int
groupAccess {[key: string]: number}
projectAccess {[key: string]: number}
group_access Mapping[str, int]
project_access Mapping[str, int]

GetProjectsProjectSharedWithGroup

GroupAccessLevel string
GroupId int
The ID of the group owned by the authenticated user to look projects for within. Cannot be used with min_access_level, with_programming_language or statistics.
GroupName string
GroupAccessLevel string
GroupId int
The ID of the group owned by the authenticated user to look projects for within. Cannot be used with min_access_level, with_programming_language or statistics.
GroupName string
groupAccessLevel string
groupId number
The ID of the group owned by the authenticated user to look projects for within. Cannot be used with min_access_level, with_programming_language or statistics.
groupName string
group_access_level str
group_id int
The ID of the group owned by the authenticated user to look projects for within. Cannot be used with min_access_level, with_programming_language or statistics.
group_name str

Package Details

Repository
https://github.com/pulumi/pulumi-gitlab
License
Apache-2.0
Notes
This Pulumi package is based on the gitlab Terraform Provider.