Skip to content
This repository was archived by the owner on Jul 6, 2026. It is now read-only.

schubergphilis/terraform-gitlab-mcaf-project

Repository files navigation

Important

This repository has moved to schubergphilis-ep/terraform-gitlab-mcaf-project. Please update your references and use the new location for issues, PRs, and contributions.

terraform-gitlab-mcaf-project

Terraform module to create and manage a GitLab project.

IMPORTANT: We do not pin modules to versions in our examples. We highly recommend that in your code you pin the version to the exact version you are using so that your infrastructure remains stable.

Requirements

Name Version
terraform >= 1.3.0
gitlab >= 17.10.0

Providers

Name Version
gitlab >= 17.10.0

Modules

No modules.

Resources

Name Type
gitlab_branch_protection.default resource
gitlab_pipeline_schedule.default resource
gitlab_project.default resource
gitlab_project_approval_rule.default resource
gitlab_project_level_mr_approvals.default resource
gitlab_project_variable.default resource
gitlab_group.default data source
gitlab_group.groups data source
gitlab_group.project_approval_rule_groups data source
gitlab_user.project_approval_rule_users data source
gitlab_user.users data source

Inputs

Name Description Type Default Required
name The name of the project string n/a yes
namespace The namespace (group or user) of the project string n/a yes
archive_on_destroy Archive the project instead of deleting it when the resource is destroyed. bool false no
branch_protection Branch protection settings
map(object({
allow_force_push = optional(bool, false)
code_owner_approval_required = optional(bool, false)
merge_access_level = optional(string, "developer")
push_access_level = optional(string, "no one")
unprotect_access_level = optional(string)

groups_allowed_to_merge = optional(list(string), [])
groups_allowed_to_push = optional(list(string), [])
groups_allowed_to_unprotect = optional(list(string), [])

users_allowed_to_merge = optional(list(string), [])
users_allowed_to_push = optional(list(string), [])
users_allowed_to_unprotect = optional(list(string), [])
}))
{} no
ci_config_path Custom Path to CI config file. string ".gitlab-ci.yml" no
ci_default_git_depth Default number of revisions for shallow cloning. number 3 no
cicd_variables CICD variables accessable during pipeline runs.
map(object({
value = string
protected = bool
description = optional(string, null)
hidden = optional(bool, false)
masked = optional(bool, false)
raw = optional(bool, false)
variable_type = optional(string, "env_var")
}))
{} no
commit_message_regex A regex pattern that a commit message must match in order to be accepted. string null no
default_branch The default branch for the project string "main" no
description A description for the GitLab project string null no
import_url Git URL to a repository to be imported string null no
import_url_password Password for the import_url string null no
import_url_username Username for the import_url string null no
initialize_with_readme Create default branch with first commit containing a README.md file bool true no
issues_access_level Set the issues access level. Valid values are "disabled", "private", "enabled". string "disabled" no
merge_request_approval_rule Allows to manage the lifecycle of a Merge Request-level approval rule.
object({
disable_overriding_approvers_per_merge_request = optional(bool, false)
merge_requests_author_approval = optional(bool, false)
merge_requests_disable_committers_approval = optional(bool, false)
reset_approvals_on_push = optional(bool, true)
})
{} no
mirror Set to true if you want to create a mirror repository bool false no
mirror_overwrites_diverged_branches If true, diverged branches will be overwritten during mirroring bool true no
mirror_trigger_builds If true, a pipeline will be triggered when a mirror update occurs bool true no
only_allow_merge_if_all_discussions_are_resolved Set to true if you want allow merges only if all discussions are resolved. bool false no
only_allow_merge_if_pipeline_succeeds Set to true if you want allow merges only if a pipeline succeeds. bool false no
pipeline_schedule Pipeline scheduler parameter.
object({
active = optional(bool, true)
cron = string
cron_timezone = optional(string, "UTC")
description = string
ref = optional(string, "refs/heads/main")
take_ownership = optional(bool, false)
})
null no
prevent_secrets GitLab rejects any files that are likely to contain secrets. bool true no
project_approval_rule Allows to manage the lifecycle of a project-level approval rule.
object({
name = optional(string, "project approval rule")
applies_to_all_protected_branches = optional(bool, true)
approvals_required = optional(number, 1)
groups = optional(list(string), [])
protected_branches = optional(list(string), null)
users = optional(list(string), [])
})
{} no
reject_unsigned_commits GitLab rejects any unsigned commits. bool true no
remove_source_branch_after_merge Enable "Delete source branch" option by default for all new merge requests. bool true no
snippets_access_level Set the snippets access level. Valid values are "disabled", "private", "enabled". string "disabled" no
squash_option Squash commits when merge request string "default_off" no
visibility Set the GitLab project as public, private or internal string "private" no
wiki_access_level Set the wiki access level. Valid values are "disabled", "private", "enabled". string "disabled" no

Outputs

Name Description
http_url_to_repo HTTP URL to the repository
id Project ID
path Project path
path_with_namespace Project path with namespace
ssh_url_to_repo SSH URL to the repository
web_url Project web URL

About

Terraform module to create and manage a GitLab project.

Topics

Resources

License

Contributing

Stars

1 star

Watchers

22 watching

Forks

Packages

 
 
 

Contributors

Languages