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.
Name | Version |
---|---|
terraform | >= 1.3.0 |
gitlab | >= 16.0.0 |
Name | Version |
---|---|
gitlab | >= 16.0.0 |
No modules.
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 |
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 |
approvals_before_merge | Number of merge request approvals required for merging | number |
1 |
no |
branch_protection | Branch protection settings | map(object({ |
{} |
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({ |
{} |
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 |
initialize_with_readme | Create default branch with first commit containing a README.md file | bool |
true |
no |
issues_enabled | Enable issue tracking for the project | bool |
false |
no |
merge_request_approval_rule | Allows to manage the lifecycle of a Merge Request-level approval rule. | object({ |
{} |
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({ |
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({ |
{} |
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_enabled | Enable snippets for the project | bool |
false |
no |
squash_option | Squash commits when merge request | string |
"default_off" |
no |
use_group_settings | Ignore settings that can also be set on a group level to prevent conflicts | bool |
false |
no |
visibility | Set the GitLab project as public, private or internal | string |
"private" |
no |
wiki_enabled | Enable wiki for the project | bool |
false |
no |
Name | Description |
---|---|
id | GitLab project id |
path | GitLab project path |
path_with_namespace | GitLab project path with namespace |