Skip to content

Repository files navigation

terraform-gitlab-group

Terraform module to manage the following GitLab resources:

  • gitlab_group

Usage

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 = "2.0.0"

  name = "Example (group)"
  path = "example-group-48165"
}

Requirements

Name Version
terraform >= 1.0
gitlab ~> 19.0

Providers

Name Version
gitlab ~> 19.0

Modules

No modules.

Resources

Name Type
gitlab_group.this resource

Inputs

Name Description Type Default Required
allow_merge_on_skipped_pipeline Allow merging merge requests when the pipeline is skipped. Only applies when only_allow_merge_if_pipeline_succeeds is true. Premium and Ultimate only bool null no
allowed_email_domains_list A list of email address domains to allow group access list(string) [] no
archive_on_destroy Set to true to archive the group instead of deleting on destroy bool null no
auto_devops_enabled Default to Auto DevOps pipeline for all projects within this group bool false no
avatar A local path to the avatar image to upload string null no
avatar_hash The hash of the avatar image. Use filesha256() whenever possible string null no
default_branch Initial default branch name string null no
default_branch_protection_defaults The default branch protection defaults for the group object({ allow_force_push = optional(bool, false) allowed_to_merge = optional(list(string), []) allowed_to_push = optional(list(string), []) code_owner_approval_required = optional(bool, false) developer_can_initial_push = optional(bool, false) }) null no
description The group's description string null no
emails_enabled Enable email notifications bool true no
extra_shared_runners_minutes_limit Additional CI/CD minutes for this group. Can be set by administrators only number null no
ip_restriction_ranges A list of IP addresses or subnet masks to restrict group access. Only allowed on top level groups list(string) [] no
lfs_enabled Enable/disable Large File Storage (LFS) for the projects in this group bool true no
max_artifacts_size The maximum file size in megabytes for individual job artifacts number null no
membership_lock Users cannot be added to projects in this group bool false no
mentions_disabled Disable the capability of a group from getting mentioned bool false no
name The name of the group string n/a yes
only_allow_merge_if_all_discussions_are_resolved Only allow merging merge requests when all discussions are resolved. Premium and Ultimate only bool null no
only_allow_merge_if_pipeline_succeeds Only allow merging merge requests if the pipeline succeeds. Premium and Ultimate only bool null no
parent_id ID of the parent group (creates a nested group) number null no
path The path of the group string n/a yes
permanently_remove_on_delete Whether the group should be permanently removed during a delete operation. This only works with subgroups bool null no
prevent_forking_outside_group When enabled, users can not fork projects from this group to external namespaces bool false no
prevent_sharing_groups_outside_hierarchy When enabled, users cannot invite other groups outside of the top-level group's hierarchy. Only available for top-level groups bool false no
project_creation_level Determine if developers can create projects in the group string "developer" no
push_rules Push rules for the group object({ author_email_regex = optional(string) branch_name_regex = optional(string) commit_committer_check = optional(bool) commit_committer_name_check = optional(bool) commit_message_negative_regex = optional(string) commit_message_regex = optional(string) deny_delete_tag = optional(bool) file_name_regex = optional(string) max_file_size = optional(number) member_check = optional(bool) prevent_secrets = optional(bool) reject_non_dco_commits = optional(bool) reject_unsigned_commits = optional(bool) }) null no
request_access_enabled Allow users to request member access bool true no
require_two_factor_authentication Require all users in this group to setup Two-factor authentication bool false no
share_with_group_lock Prevent sharing a project with another group within this group bool false no
shared_runners_minutes_limit Maximum number of monthly CI/CD minutes for this group. Can be set by administrators only number null no
shared_runners_setting Enable or disable shared runners for a group's subgroups and projects string "enabled" no
subgroup_creation_level Allowed to create subgroups string "maintainer" no
two_factor_grace_period Time before Two-factor authentication is enforced (in hours) number 48 no
visibility_level The group's visibility string "private" no
wiki_access_level The group's wiki access level. Only available on Premium and Ultimate plans string "enabled" no

Outputs

Name Description
avatar_url The URL of the avatar image
full_name The full name of the group
full_path The full path of the group
id The ID of this resource
runners_token The group level registration token to use during runner setup
web_url Web URL of the group

Authors

Created and maintained by Dennis Hoppe.

License

Apache 2 licensed. See LICENSE for full details.