GetProjects

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,
        })));
    }

}

Coming soon!

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",
        }));
    }

}

Coming soon!

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>
function  get_projects(archived=None, group_id=None, include_subgroups=None, max_queryable_pages=None, membership=None, min_access_level=None, order_by=None, owned=None, page=None, per_page=None, search=None, simple=None, sort=None, starred=None, statistics=None, visibility=None, with_custom_attributes=None, with_issues_enabled=None, with_merge_requests_enabled=None, with_programming_language=None, with_shared=None, opts=None)
func GetProjects(ctx *Context, args *GetProjectsArgs, opts ...InvokeOption) (*GetProjectsResult, error)
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 float

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 float

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 float

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 float
per_page float
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 List[GetProjectsProject]

A list containing the projects matching the supplied arguments

archived bool
group_id float
include_subgroups bool
max_queryable_pages float
membership bool
min_access_level float
order_by str
owned bool
page float
per_page float
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

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

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.GetProjectsProjectForkedFromProjectArgs
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.GetProjectsProjectNamespaceArgs
OnlyAllowMergeIfAllDiscussionsAreResolved bool
OnlyAllowMergeIfPipelineSucceeds bool
OnlyMirrorProtectedBranches bool
OpenIssuesCount int
Owner Pulumi.GitLab.Inputs.GetProjectsProjectOwnerArgs
Path string
PathWithNamespace string

In group/subgroup/project or user/project format.

Permissions Pulumi.GitLab.Inputs.GetProjectsProjectPermissionsArgs
Public bool

Whether the project is public.

PublicBuilds bool
ReadmeUrl string
RequestAccessEnabled bool
ResolveOutdatedDiffDiscussions bool
RunnersToken string
SharedRunnersEnabled bool
SharedWithGroups List<Pulumi.GitLab.Inputs.GetProjectsProjectSharedWithGroupArgs>
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
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
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 Dict[str, str]
approvals_before_merge float

The numbers of approvals needed in a merge requests.

archived bool

Limit by archived status.

avatarUrl str
ciConfigPath str
container_registry_enabled bool
created_at str
creatorId float
customAttributes List[Any>]
default_branch str
description str
forkedFromProject Dict[GetProjectsProjectForkedFromProject]
forksCount float
http_url_to_repo str

The HTTP clone URL of the project.

id float

The ID of the project.

importError str
importStatus str
issues_enabled bool
jobsEnabled bool

Whether pipelines are enabled for the project.

lastActivityAt str
lfs_enabled bool
merge_method str
merge_requests_enabled bool
mirror bool
mirrorOverwritesDivergedBranches bool
mirrorTriggerBuilds bool
mirrorUserId float
name str

The name of the project.

nameWithNamespace str

In group / subgroup / project or user / project format.

namespace Dict[GetProjectsProjectNamespace]
onlyMirrorProtectedBranches bool
only_allow_merge_if_all_discussions_are_resolved bool
only_allow_merge_if_pipeline_succeeds bool
openIssuesCount float
owner Dict[GetProjectsProjectOwner]
path str
pathWithNamespace str

In group/subgroup/project or user/project format.

permissions Dict[GetProjectsProjectPermissions]
public bool

Whether the project is public.

publicBuilds bool
readmeUrl str
request_access_enabled bool
resolveOutdatedDiffDiscussions bool
runners_token str
shared_runners_enabled bool
shared_with_groups List[GetProjectsProjectSharedWithGroup]
snippets_enabled bool
ssh_url_to_repo str

The SSH clone URL of the project.

starCount float
statistics Dict[str, Integer]

Include project statistics. Cannot be used with group_id.

tagLists List[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

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

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 float

The ID of the project.

name str

The name of the project.

nameWithNamespace str

In group / subgroup / project or user / project format.

path str
pathWithNamespace str

In group/subgroup/project or user/project format.

web_url str

GetProjectsProjectNamespace

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

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 float

The ID of the project.

kind str
name str

The name of the project.

path str

GetProjectsProjectOwner

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

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
avatarUrl str
id float

The ID of the project.

name str

The name of the project.

state str
username str
websiteUrl str

GetProjectsProjectPermissions

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

GroupAccess Dictionary<string, int>
ProjectAccess Dictionary<string, int>
GroupAccess map[string]int
ProjectAccess map[string]int
groupAccess {[key: string]: number}
projectAccess {[key: string]: number}
groupAccess Dict[str, Integer]
projectAccess Dict[str, Integer]

GetProjectsProjectSharedWithGroup

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

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
groupAccessLevel str
groupName str
group_id float

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.

Package Details

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