Skip to content

Repository files navigation

terraform-gitlab-project

Releases

Terraform Module Registry

Terraform module for managing a GitLab project

Features

  • Manage GitLab projects with customizable settings
  • Configure branch protections and merge request approval rules
  • Integrate with external wikis
  • Define project environments and protected environments

Usage

Basic usage of this module is as follows:

module "example" {
    source = "wisk-aero-oss/project/gitlab"
    # Recommend pinning every module to a specific version
    # version = "x.x.x"
    # Required variables
        description =
        name =
}

Requirements

Name Version
terraform >= 1.5
gitlab >= 18.5

Providers

Name Version
gitlab 18.8.2

Modules

No modules.

Resources

Name Type
gitlab_branch_protection.default resource
gitlab_project.self resource
gitlab_project_approval_rule.any_approver resource
gitlab_project_environment.self resource
gitlab_project_integration_external_wiki.wiki resource
gitlab_project_level_mr_approvals.self resource
gitlab_project_protected_environment.self resource

Inputs

Name Description Type Default Required
avatar Path to avatar image file. Image must be 192x192 pixels and less than 200kb string "" no
branch_allow_force_push Can be set to true to allow users with push access to force push. bool false no
branch_code_owner_approval_required Can be set to true to require code owner approval before merging. bool true no
branch_merge_access_level Access levels allowed to merge. Valid values are: no one, developer, maintainer, admin. string "developer" no
branch_push_access_level Access levels allowed to push. Valid values are: no one, developer, maintainer, admin. string "developer" no
branch_unprotect_access_level Access levels allowed to unprotect. Valid values are: developer, maintainer, admin. string "developer" no
builds_access_level Set the builds access level. Valid values are disabled, private, enabled. string "enabled" no
ci_forward_deployment_enabled When a new deployment job starts, skip older deployment jobs that are still pending. bool true no
ci_forward_deployment_rollback_allowed Allow job retries even if the deployment job is outdated. bool false no
default_branch The default branch for the project. string "main" no
description A description of the project. string n/a yes
emails_enabled Enable email notifications. bool true no
environments Deployment environments
map(object({
auto_stop_setting = optional(string)
description = string
protected = optional(bool, false)
approval_access = optional(string, "developer")
required_approvals = optional(number, 1)
deploy_access = optional(string, "developer")
tier = optional(string, "development")
}))
{
"production": {
"description": "Production Environment",
"protected": true,
"tier": "production"
}
}
no
environments_access_level Set the environments access level. Valid values are disabled, private, enabled. string "disabled" no
feature_flags_access_level Set the feature flags access level. Valid values are disabled, private, enabled. string "disabled" no
group_runners_enabled Enable group runners for this project. bool true no
infrastructure_access_level Set the infrastructure access level. Valid values are disabled, private, enabled. string "enabled" no
issues_access_level Set the issues access level. Valid values are disabled, private, enabled. string "disabled" no
merge_commit_template Template used to create merge commit message in merge requests. string "### Description\n<Insert your PR description here>\n\n### How-to Test\n<Insert information on how to test this PR>\n\n### Commits in this MR\n%{all_commits}\n\n# DO NOT EDIT BELOW THIS LINE\n/assign_reviewer @devs-we-want-to-review\n" no
model_experiments_access_level Set visibility of machine learning model experiments. Valid values are disabled, private, enabled. string "disabled" no
model_registry_access_level Set visibility of machine learning model registry. Valid values are disabled, private, enabled. string "disabled" no
monitor_access_level Set the monitor access level. Valid values are disabled, private, enabled. string "enabled" no
mr_approval_disable_overriding_approvers_per_merge_request Set to true to disable overriding approvers per merge request. bool false no
mr_approval_merge_requests_author_approval Set to true to allow merge requests authors to approve their own merge requests. bool false no
mr_approval_merge_requests_disable_committers_approval Set to true to disable merge request committers from approving their own merge requests. bool true no
mr_approval_reset_approvals_on_push Set to true to remove all approvals in a merge request when new commits are pushed to its source branch. bool true no
name The name of the project. string n/a yes
namespace_id The namespace (group or user) of the project. string "" no
path The path of the project string null no
public_jobs If true, jobs can be viewed by non-project members. bool false no
push_prevent_secrets GitLab will reject any files that are likely to contain secrets. bool true no
repository_access_level Set the repository access level. Valid values are disabled, private, enabled. string "enabled" no
requirements_access_level Set the requirements access level. Valid values are disabled, private, enabled. string "enabled" no
squash_option Squash commits when merge request is merged. Valid values are never (Do not allow), always (Require), default_on (Encourage), or default_off (Allow). The default value is default_off (Allow). string "default_on" no
topics The list of topics for the project. set(string) [] no
visibility_level Set to public to create a public project. Valid values are private, internal, public. string "internal" no
wiki_access_level Set the wiki access level. Valid values are disabled, private, enabled. string "disabled" no
wiki_url External Wiki URL string "" no

Outputs

No outputs.

About

Terraform module to manage GitLab project

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages