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 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 | >= 17.10.0 |
| Name | Version |
|---|---|
| gitlab | >= 17.10.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 |
| 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({ |
{} |
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 |
| 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({ |
{} |
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({ |
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_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 |
| 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 |