The gitlab_project
data source allows details of a project to be retrieved by either its ID or its path with namespace.
Upstream API: GitLab REST API docs
# To search for a project by ID, pass in the ID value
data "gitlab_project" "example" {
id = 30
}
# To search for a project based on a path, use `path_with_namespace` instead
data "gitlab_project" "example" {
path_with_namespace = "foo/bar/baz"
}
ci_default_git_depth
(Number) Default number of revisions for shallow cloning.id
(String) The integer that uniquely identifies the project within the gitlab install.path_with_namespace
(String) The path of the repository with namespace.public_builds
(Boolean) If true, jobs can be viewed by non-project members.analytics_access_level
(String) Set the analytics access level. Valid values are disabled
, private
, enabled
.archived
(Boolean) Whether the project is in read-only mode (archived).auto_cancel_pending_pipelines
(String) Auto-cancel pending pipelines. This isn’t a boolean, but enabled/disabled.auto_devops_deploy_strategy
(String) Auto Deploy strategy. Valid values are continuous
, manual
, timed_incremental
.auto_devops_enabled
(Boolean) Enable Auto DevOps for this project.autoclose_referenced_issues
(Boolean) Set whether auto-closing referenced issues on default branch.build_git_strategy
(String) The Git strategy. Defaults to fetch.build_timeout
(Number) The maximum amount of time, in seconds, that a job can run.builds_access_level
(String) Set the builds access level. Valid values are disabled
, private
, enabled
.ci_config_path
(String) CI config file path for the project.ci_restrict_pipeline_cancellation_role
(String) The role required to cancel a pipeline or job. Introduced in GitLab 16.8. Premium and Ultimate only. Valid values are developer
, maintainer
, no one
ci_separated_caches
(Boolean) Use separate caches for protected branches.container_expiration_policy
(List of Object) Set the image cleanup policy for this project. Note: this field is sometimes named container_expiration_policy_attributes
in the GitLab Upstream API. (see below for nested schema)container_registry_access_level
(String) Set visibility of container registry, for this project. Valid values are disabled
, private
, enabled
.default_branch
(String) The default branch for the project.description
(String) A description of the project.emails_disabled
(Boolean, Deprecated) Disable email notifications.emails_enabled
(Boolean) Enable email notifications.empty_repo
(Boolean) Whether the project is empty.environments_access_level
(String) Set the environments access level. Valid values are disabled
, private
, enabled
.external_authorization_classification_label
(String) The classification label for the project.feature_flags_access_level
(String) Set the feature flags access level. Valid values are disabled
, private
, enabled
.forking_access_level
(String) Set the forking access level. Valid values are disabled
, private
, enabled
.http_url_to_repo
(String) URL that can be provided to git clone
to clone theimport_url
(String) URL the project was imported from.infrastructure_access_level
(String) Set the infrastructure access level. Valid values are disabled
, private
, enabled
.issues_access_level
(String) Set the issues access level. Valid values are disabled
, private
, enabled
.issues_enabled
(Boolean) Enable issue tracking for the project.keep_latest_artifact
(Boolean) Disable or enable the ability to keep the latest artifact for this project.lfs_enabled
(Boolean) Enable LFS for the project.merge_commit_template
(String) Template used to create merge commit message in merge requests. (Introduced in GitLab 14.5.)merge_pipelines_enabled
(Boolean) Enable or disable merge pipelines.merge_requests_access_level
(String) Set the merge requests access level. Valid values are disabled
, private
, enabled
.merge_requests_enabled
(Boolean) Enable merge requests for the project.merge_trains_enabled
(Boolean) Enable or disable merge trains.monitor_access_level
(String) Set the monitor access level. Valid values are disabled
, private
, enabled
.name
(String) The name of the project.namespace_id
(Number) The namespace (group or user) of the project. Defaults to your user.path
(String) The path of the repository.pipelines_enabled
(Boolean) Enable pipelines for the project.printing_merge_request_link_enabled
(Boolean) Show link to create/view merge request when pushing from the command linepush_rules
(List of Object) Push rules for the project. Push rules are only available on Enterprise plans and if the authenticated has permissions to read them. (see below for nested schema)releases_access_level
(String) Set the releases access level. Valid values are disabled
, private
, enabled
.remove_source_branch_after_merge
(Boolean) Enable Delete source branch
option by default for all new merge requestsrepository_access_level
(String) Set the repository access level. Valid values are disabled
, private
, enabled
.repository_storage
(String) Which storage shard the repository is on. (administrator only)request_access_enabled
(Boolean) Allow users to request member access.requirements_access_level
(String) Set the requirements access level. Valid values are disabled
, private
, enabled
.resolve_outdated_diff_discussions
(Boolean) Automatically resolve merge request diffs discussions on lines changed with a push.restrict_user_defined_variables
(Boolean) Allow only users with the Maintainer role to pass user-defined variables when triggering a pipeline.runners_token
(String, Sensitive) Registration token to use during runner setup.security_and_compliance_access_level
(String) Set the security and compliance access level. Valid values are disabled
, private
, enabled
.shared_with_groups
(List of Object) Describes groups which have access shared to this project. (see below for nested schema)snippets_access_level
(String) Set the snippets access level. Valid values are disabled
, private
, enabled
.snippets_enabled
(Boolean) Enable snippets for the project.squash_commit_template
(String) Template used to create squash commit message in merge requests. (Introduced in GitLab 14.6.)ssh_url_to_repo
(String) URL that can be provided to git clone
to clone thesuggestion_commit_message
(String) The commit message used to apply merge request suggestions.topics
(Set of String) The list of topics for the project.visibility_level
(String) Repositories are created as private by default.web_url
(String) URL that can be used to find the project in a browser.wiki_access_level
(String) Set the wiki access level. Valid values are disabled
, private
, enabled
.wiki_enabled
(Boolean) Enable wiki for the project.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)push_rules
Read-Only:
author_email_regex
(String)branch_name_regex
(String)commit_committer_check
(Boolean)commit_message_negative_regex
(String)commit_message_regex
(String)deny_delete_tag
(Boolean)file_name_regex
(String)max_file_size
(Number)member_check
(Boolean)prevent_secrets
(Boolean)reject_unsigned_commits
(Boolean)shared_with_groups
Read-Only:
group_access_level
(Number)group_full_path
(String)group_id
(Number)group_name
(String)