Terraform module to manage the following GitLab resources:
- gitlab_project
Copy and paste the following code snippet to your Terraform configuration,
specify the required variables and run the command terraform init.
module "gitlab_group" {
source = "gitlab.com/terraform-child-modules-48151/terraform-gitlab-group/local"
version = "1.1.4"
name = "Example (group)"
path = "example-group-48165"
}
module "gitlab_project" {
source = "gitlab.com/terraform-child-modules-48151/terraform-gitlab-project/local"
version = "1.1.5"
name = "example-project"
description = "Example (project)"
namespace_id = module.gitlab_group.id
}| Name | Version |
|---|---|
| terraform | >= 1.0 |
| gitlab | ~> 18.0 |
| Name | Version |
|---|---|
| gitlab | ~> 18.0 |
No modules.
| Name | Type |
|---|---|
| gitlab_project.this | resource |
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
| allow_merge_on_skipped_pipeline | Set to true if you want to treat skipped pipelines as if they finished with success. | bool |
false |
no |
| analytics_access_level | Set the analytics access level | string |
"enabled" |
no |
| approvals_before_merge | Number of merge request approvals required for merging | number |
0 |
no |
| archive_on_destroy | Set to true to archive the project instead of deleting on destroy | bool |
false |
no |
| archived | Whether the project is in read-only mode (archived) | bool |
false |
no |
| auto_cancel_pending_pipelines | Auto-cancel pending pipelines | string |
"enabled" |
no |
| auto_devops_deploy_strategy | Auto Deploy strategy | string |
"continuous" |
no |
| auto_devops_enabled | Enable Auto DevOps for this project | bool |
false |
no |
| autoclose_referenced_issues | Set whether auto-closing referenced issues on default branch | bool |
true |
no |
| avatar | A local path to the avatar image to upload | string |
null |
no |
| avatar_hash | The hash of the avatar image | string |
null |
no |
| build_git_strategy | The Git strategy | string |
"fetch" |
no |
| build_timeout | The maximum amount of time, in seconds, that a job can run | number |
3600 |
no |
| builds_access_level | Set the builds access level | string |
"enabled" |
no |
| ci_config_path | Custom Path to CI config file | string |
null |
no |
| ci_default_git_depth | Default number of revisions for shallow cloning | number |
20 |
no |
| ci_delete_pipelines_in_seconds | Pipelines older than the configured time are deleted | number |
null |
no |
| ci_forward_deployment_enabled | When a new deployment job starts, skip older deployment jobs that are still pending | bool |
true |
no |
| ci_id_token_sub_claim_components | Fields included in the sub claim of the ID Token | list(string) |
[ "project_path", "ref_type", "ref" ] |
no |
| ci_pipeline_variables_minimum_override_role | The minimum role required to set variables when running pipelines and jobs | string |
"developer" |
no |
| ci_separated_caches | Use separate caches for protected branches | bool |
true |
no |
| container_expiration_policy | Set the image cleanup policy for this project | list(string) |
[] |
no |
| container_registry_access_level | Set visibility of container registry, for this project | string |
"enabled" |
no |
| default_branch | The default branch for the project | string |
"main" |
no |
| description | A description of the project | string |
null |
no |
| emails_enabled | Enable email notifications | bool |
true |
no |
| environments_access_level | Set the environments access level | string |
"enabled" |
no |
| external_authorization_classification_label | The classification label for the project | string |
null |
no |
| feature_flags_access_level | Set the feature flags access level | string |
"enabled" |
no |
| forked_from_project_id | The ID of the project to fork | number |
null |
no |
| forking_access_level | Set the forking access level | string |
"enabled" |
no |
| group_runners_enabled | enable group runners for this project | bool |
true |
no |
| group_with_project_templates_id | For group-level custom templates, specifies ID of group from which all the custom project templates are sourced | number |
null |
no |
| import_url | Git URL to a repository to be imported | string |
null |
no |
| import_url_password | The password for the import_url | string |
null |
no |
| import_url_username | The username for the import_url | string |
null |
no |
| infrastructure_access_level | Set the infrastructure access level | string |
"enabled" |
no |
| initialize_with_readme | Create main branch with first commit containing a README.md file | bool |
true |
no |
| issues_access_level | Set the issues access level | string |
"enabled" |
no |
| issues_enabled | Enable issue tracking for the project | bool |
true |
no |
| issues_template | Sets the template for new issues in the project | string |
null |
no |
| keep_latest_artifact | Disable or enable the ability to keep the latest artifact for this project | bool |
true |
no |
| lfs_enabled | Enable LFS for the project | bool |
true |
no |
| merge_commit_template | Template used to create merge commit message in merge requests | string |
null |
no |
| merge_method | Set the merge method | string |
"merge" |
no |
| merge_pipelines_enabled | Enable or disable merge pipelines | bool |
false |
no |
| merge_requests_access_level | Set the merge requests access level | string |
"enabled" |
no |
| merge_requests_enabled | Enable merge requests for the project | bool |
true |
no |
| merge_requests_template | Sets the template for new merge requests in the project | string |
null |
no |
| merge_trains_enabled | Enable or disable merge trains | bool |
false |
no |
| mirror | Enable project pull mirror | bool |
false |
no |
| mirror_overwrites_diverged_branches | Enable overwrite diverged branches for a mirrored project | bool |
true |
no |
| mirror_trigger_builds | Enable trigger builds on pushes for a mirrored project | bool |
false |
no |
| model_experiments_access_level | Set visibility of machine learning model experiments | string |
"enabled" |
no |
| model_registry_access_level | Set visibility of machine learning model registry | string |
"enabled" |
no |
| monitor_access_level | Set the monitor access level | string |
"enabled" |
no |
| mr_default_target_self | For forked projects, target merge requests to this project | bool |
false |
no |
| name | The name of the project | string |
n/a | yes |
| namespace_id | The namespace (group or user) of the project | number |
null |
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 |
| only_mirror_protected_branches | Enable only mirror protected branches for a mirrored project | bool |
true |
no |
| packages_enabled | Enable packages repository for the project | bool |
true |
no |
| pages_access_level | Enable pages access control | string |
"private" |
no |
| path | The path of the repository | string |
null |
no |
| printing_merge_request_link_enabled | Show link to create/view merge request when pushing from the command line | bool |
true |
no |
| public_jobs | If true, jobs can be viewed by non-project members | bool |
true |
no |
| push_rules | Push rules for the project | list(string) |
[] |
no |
| releases_access_level | Set the releases access level | string |
"enabled" |
no |
| remove_source_branch_after_merge | Enable Delete source branch option by default for all new merge requests | bool |
true |
no |
| repository_access_level | Set the repository access level | string |
"enabled" |
no |
| repository_storage | Which storage shard the repository is on | string |
null |
no |
| request_access_enabled | Allow users to request member access | bool |
true |
no |
| requirements_access_level | Set the requirements access level | string |
"enabled" |
no |
| resolve_outdated_diff_discussions | Automatically resolve merge request diffs discussions on lines changed with a push | bool |
false |
no |
| restrict_user_defined_variables | Allow only users with the Maintainer role to pass user-defined variables when triggering a pipeline | bool |
false |
no |
| security_and_compliance_access_level | Set the security and compliance access level | string |
"private" |
no |
| shared_runners_enabled | Enable shared runners for this project | bool |
true |
no |
| skip_wait_for_default_branch_protection | If true, the default behavior to wait for the default branch protection to be created is skipped | bool |
false |
no |
| snippets_access_level | Set the snippets access level | string |
"enabled" |
no |
| snippets_enabled | Enable snippets for the project | bool |
true |
no |
| squash_commit_template | Template used to create squash commit message in merge requests | string |
null |
no |
| squash_option | Squash commits when merge request | string |
"default_off" |
no |
| suggestion_commit_message | The commit message used to apply merge request suggestions | string |
null |
no |
| tags | The list of tags for a project | set(string) |
[] |
no |
| template_name | When used without use_custom_template, name of a built-in project template | string |
null |
no |
| template_project_id | When used with use_custom_template, project ID of a custom project template | number |
null |
no |
| timeouts | Timeout, in minutes | list(string) |
[] |
no |
| topics | The list of topics for the project | set(string) |
[] |
no |
| use_custom_template | Use either custom instance or group (with group_with_project_templates_id) project template (enterprise edition) | bool |
false |
no |
| visibility_level | Set to public to create a public project | string |
"private" |
no |
| wiki_access_level | Set the wiki access level | string |
"enabled" |
no |
| wiki_enabled | Enable wiki for the project | bool |
true |
no |
| Name | Description |
|---|---|
| avatar_url | The URL of the avatar image |
| empty_repo | Whether the project is empty |
| http_url_to_repo | URL that can be provided to git clone to clone the project |
| id | The ID of this resource |
| path_with_namespace | The path of the repository with namespace |
| runners_token | Registration token to use during runner setup |
| ssh_url_to_repo | URL that can be provided to git clone to clone the project |
| web_url | URL that can be used to find the project in a browser |
Created and maintained by Dennis Hoppe.
Apache 2 licensed. See LICENSE for full details.