The gitlab_projects
data source allows details of multiple projects to be retrieved. Optionally filtered by the set attributes.
Upstream API: GitLab REST API docs
# List projects within a group tree
data "gitlab_group" "mygroup" {
full_path = "mygroup"
}
data "gitlab_projects" "group_projects" {
group_id = data.gitlab_group.mygroup.id
order_by = "name"
include_subgroups = true
with_shared = false
}
# List projects using the search syntax
data "gitlab_projects" "projects" {
search = "postgresql"
visibility = "private"
}
archived
(Boolean) Limit by archived status.group_id
(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
.include_subgroups
(Boolean) Include projects in subgroups of this group. Default is false
. Needs group_id
.max_queryable_pages
(Number) The maximum number of project results pages that may be queried. Prevents overloading your Gitlab instance in case of a misconfiguration.membership
(Boolean) Limit by projects that the current user is a member of.min_access_level
(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
.order_by
(String) Return projects ordered ordered by: id
, name
, path
, created_at
, updated_at
, last_activity_at
, similarity
, repository_size
, storage_size
, packages_size
, wiki_size
. Some values or only available in certain circumstances. See upstream docs for details.owned
(Boolean) Limit by projects owned by the current user.page
(Number) The first page to begin the query on.per_page
(Number) The number of results to return per page.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
.topic
(Set of String) Limit by projects that have all of the given topics.visibility
(String) Limit by visibility public
, internal
, or private
.with_custom_attributes
(Boolean) Include custom attributes in response _(admins only)_.with_issues_enabled
(Boolean) Limit by projects with issues feature enabled. Default is false
.with_merge_requests_enabled
(Boolean) Limit by projects with merge requests feature enabled. Default is false
.with_programming_language
(String) Limit by projects which use the given programming language. Cannot be used with group_id
.with_shared
(Boolean) Include projects shared to this group. Default is true
. Needs group_id
.id
(String) The ID of this resource.projects
(List of Object) A list containing the projects matching the supplied arguments (see below for nested schema)projects
Read-Only:
_links
(Map of String)allow_merge_on_skipped_pipeline
(Boolean)analytics_access_level
(String)approvals_before_merge
(Number)archived
(Boolean)auto_cancel_pending_pipelines
(String)auto_devops_deploy_strategy
(String)auto_devops_enabled
(Boolean)autoclose_referenced_issues
(Boolean)avatar_url
(String)build_coverage_regex
(String)build_git_strategy
(String)build_timeout
(Number)builds_access_level
(String)ci_config_path
(String)ci_default_git_depth
(Number)ci_forward_deployment_enabled
(Boolean)ci_restrict_pipeline_cancellation_role
(String)container_expiration_policy
(List of Object) (see below for nested schema)container_registry_access_level
(String)container_registry_enabled
(Boolean)created_at
(String)creator_id
(Number)custom_attributes
(List of Map of String)default_branch
(String)description
(String)emails_disabled
(Boolean)emails_enabled
(Boolean)empty_repo
(Boolean)environments_access_level
(String)external_authorization_classification_label
(String)feature_flags_access_level
(String)forked_from_project
(List of Object) (see below for nested schema)forking_access_level
(String)forks_count
(Number)group_runners_enabled
(Boolean)http_url_to_repo
(String)id
(Number)import_error
(String)import_status
(String)import_url
(String)infrastructure_access_level
(String)issues_access_level
(String)issues_enabled
(Boolean)jobs_enabled
(Boolean)keep_latest_artifact
(Boolean)last_activity_at
(String)lfs_enabled
(Boolean)merge_commit_template
(String)merge_method
(String)merge_pipelines_enabled
(Boolean)merge_requests_access_level
(String)merge_requests_enabled
(Boolean)merge_trains_enabled
(Boolean)mirror
(Boolean)mirror_overwrites_diverged_branches
(Boolean)mirror_trigger_builds
(Boolean)mirror_user_id
(Number)monitor_access_level
(String)name
(String)name_with_namespace
(String)namespace
(List of Object) (see below for nested schema)only_allow_merge_if_all_discussions_are_resolved
(Boolean)only_allow_merge_if_pipeline_succeeds
(Boolean)only_mirror_protected_branches
(Boolean)open_issues_count
(Number)owner
(List of Object) (see below for nested schema)packages_enabled
(Boolean)path
(String)path_with_namespace
(String)permissions
(List of Object) (see below for nested schema)public
(Boolean)public_builds
(Boolean)readme_url
(String)releases_access_level
(String)repository_access_level
(String)repository_storage
(String)request_access_enabled
(Boolean)requirements_access_level
(String)resolve_outdated_diff_discussions
(Boolean)restrict_user_defined_variables
(Boolean)runners_token
(String)security_and_compliance_access_level
(String)shared_runners_enabled
(Boolean)shared_with_groups
(List of Object) (see below for nested schema)snippets_access_level
(String)snippets_enabled
(Boolean)squash_commit_template
(String)ssh_url_to_repo
(String)star_count
(Number)statistics
(Map of Number)suggestion_commit_message
(String)tag_list
(Set of String)topics
(Set of String)visibility
(String)web_url
(String)wiki_access_level
(String)wiki_enabled
(Boolean)projects.container_expiration_policy
Read-Only:
cadence
(String)enabled
(Boolean)keep_n
(Number)name_regex
(String)name_regex_delete
(String)name_regex_keep
(String)next_run_at
(String)older_than
(String)projects.forked_from_project
Read-Only:
http_url_to_repo
(String)id
(Number)name
(String)name_with_namespace
(String)path
(String)path_with_namespace
(String)web_url
(String)projects.namespace
Read-Only:
full_path
(String)id
(Number)kind
(String)name
(String)path
(String)projects.owner
Read-Only:
avatar_url
(String)id
(Number)name
(String)state
(String)username
(String)website_url
(String)projects.permissions
Read-Only:
group_access
(Map of Number)project_access
(Map of Number)projects.shared_with_groups
Read-Only:
group_access_level
(String)group_id
(Number)group_name
(String)