published on Friday, Jun 26, 2026 by Pulumi
published on Friday, Jun 26, 2026 by Pulumi
The gitlab.GroupBranchProtection resource manages the lifecycle of a group-level protected branch.
This resource requires a GitLab Premium or Ultimate instance.
Upstream API: GitLab REST API docs
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
// Protect a branch (or wildcard) at the group level. All projects in the group
// inherit this protection. Requires GitLab Premium or Ultimate.
const main = new gitlab.GroupBranchProtection("main", {
group: "12345",
branch: "main",
allowForcePush: false,
codeOwnerApprovalRequired: true,
allowedToPushes: [
{
accessLevel: "maintainer",
},
{
userId: 42,
},
],
allowedToMerges: [
{
accessLevel: "developer",
},
{
groupId: 1337,
},
],
allowedToUnprotects: [{
accessLevel: "maintainer",
}],
});
import pulumi
import pulumi_gitlab as gitlab
# Protect a branch (or wildcard) at the group level. All projects in the group
# inherit this protection. Requires GitLab Premium or Ultimate.
main = gitlab.GroupBranchProtection("main",
group="12345",
branch="main",
allow_force_push=False,
code_owner_approval_required=True,
allowed_to_pushes=[
{
"access_level": "maintainer",
},
{
"user_id": 42,
},
],
allowed_to_merges=[
{
"access_level": "developer",
},
{
"group_id": 1337,
},
],
allowed_to_unprotects=[{
"access_level": "maintainer",
}])
package main
import (
"github.com/pulumi/pulumi-gitlab/sdk/v10/go/gitlab"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Protect a branch (or wildcard) at the group level. All projects in the group
// inherit this protection. Requires GitLab Premium or Ultimate.
_, err := gitlab.NewGroupBranchProtection(ctx, "main", &gitlab.GroupBranchProtectionArgs{
Group: pulumi.String("12345"),
Branch: pulumi.String("main"),
AllowForcePush: pulumi.Bool(false),
CodeOwnerApprovalRequired: pulumi.Bool(true),
AllowedToPushes: gitlab.GroupBranchProtectionAllowedToPushArray{
&gitlab.GroupBranchProtectionAllowedToPushArgs{
AccessLevel: pulumi.String("maintainer"),
},
&gitlab.GroupBranchProtectionAllowedToPushArgs{
UserId: pulumi.Int(42),
},
},
AllowedToMerges: gitlab.GroupBranchProtectionAllowedToMergeArray{
&gitlab.GroupBranchProtectionAllowedToMergeArgs{
AccessLevel: pulumi.String("developer"),
},
&gitlab.GroupBranchProtectionAllowedToMergeArgs{
GroupId: pulumi.Int(1337),
},
},
AllowedToUnprotects: gitlab.GroupBranchProtectionAllowedToUnprotectArray{
&gitlab.GroupBranchProtectionAllowedToUnprotectArgs{
AccessLevel: pulumi.String("maintainer"),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;
return await Deployment.RunAsync(() =>
{
// Protect a branch (or wildcard) at the group level. All projects in the group
// inherit this protection. Requires GitLab Premium or Ultimate.
var main = new GitLab.GroupBranchProtection("main", new()
{
Group = "12345",
Branch = "main",
AllowForcePush = false,
CodeOwnerApprovalRequired = true,
AllowedToPushes = new[]
{
new GitLab.Inputs.GroupBranchProtectionAllowedToPushArgs
{
AccessLevel = "maintainer",
},
new GitLab.Inputs.GroupBranchProtectionAllowedToPushArgs
{
UserId = 42,
},
},
AllowedToMerges = new[]
{
new GitLab.Inputs.GroupBranchProtectionAllowedToMergeArgs
{
AccessLevel = "developer",
},
new GitLab.Inputs.GroupBranchProtectionAllowedToMergeArgs
{
GroupId = 1337,
},
},
AllowedToUnprotects = new[]
{
new GitLab.Inputs.GroupBranchProtectionAllowedToUnprotectArgs
{
AccessLevel = "maintainer",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.GroupBranchProtection;
import com.pulumi.gitlab.GroupBranchProtectionArgs;
import com.pulumi.gitlab.inputs.GroupBranchProtectionAllowedToPushArgs;
import com.pulumi.gitlab.inputs.GroupBranchProtectionAllowedToMergeArgs;
import com.pulumi.gitlab.inputs.GroupBranchProtectionAllowedToUnprotectArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
// Protect a branch (or wildcard) at the group level. All projects in the group
// inherit this protection. Requires GitLab Premium or Ultimate.
var main = new GroupBranchProtection("main", GroupBranchProtectionArgs.builder()
.group("12345")
.branch("main")
.allowForcePush(false)
.codeOwnerApprovalRequired(true)
.allowedToPushes(
GroupBranchProtectionAllowedToPushArgs.builder()
.accessLevel("maintainer")
.build(),
GroupBranchProtectionAllowedToPushArgs.builder()
.userId(42)
.build())
.allowedToMerges(
GroupBranchProtectionAllowedToMergeArgs.builder()
.accessLevel("developer")
.build(),
GroupBranchProtectionAllowedToMergeArgs.builder()
.groupId(1337)
.build())
.allowedToUnprotects(GroupBranchProtectionAllowedToUnprotectArgs.builder()
.accessLevel("maintainer")
.build())
.build());
}
}
resources:
# Protect a branch (or wildcard) at the group level. All projects in the group
# inherit this protection. Requires GitLab Premium or Ultimate.
main:
type: gitlab:GroupBranchProtection
properties:
group: '12345'
branch: main
allowForcePush: false
codeOwnerApprovalRequired: true
allowedToPushes:
- accessLevel: maintainer
- userId: 42
allowedToMerges:
- accessLevel: developer
- groupId: 1337
allowedToUnprotects:
- accessLevel: maintainer
pulumi {
required_providers {
gitlab = {
source = "pulumi/gitlab"
}
}
}
# Protect a branch (or wildcard) at the group level. All projects in the group
# inherit this protection. Requires GitLab Premium or Ultimate.
resource "gitlab_groupbranchprotection" "main" {
group = "12345"
branch = "main"
allow_force_push = false
code_owner_approval_required = true
allowed_to_pushes {
access_level = "maintainer"
}
allowed_to_pushes {
user_id = 42
}
allowed_to_merges {
access_level = "developer"
}
allowed_to_merges {
group_id = 1337
}
allowed_to_unprotects {
access_level = "maintainer"
}
}
Create GroupBranchProtection Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new GroupBranchProtection(name: string, args: GroupBranchProtectionArgs, opts?: CustomResourceOptions);@overload
def GroupBranchProtection(resource_name: str,
args: GroupBranchProtectionArgs,
opts: Optional[ResourceOptions] = None)
@overload
def GroupBranchProtection(resource_name: str,
opts: Optional[ResourceOptions] = None,
branch: Optional[str] = None,
group: Optional[str] = None,
allow_force_push: Optional[bool] = None,
allowed_to_merges: Optional[Sequence[GroupBranchProtectionAllowedToMergeArgs]] = None,
allowed_to_pushes: Optional[Sequence[GroupBranchProtectionAllowedToPushArgs]] = None,
allowed_to_unprotects: Optional[Sequence[GroupBranchProtectionAllowedToUnprotectArgs]] = None,
code_owner_approval_required: Optional[bool] = None)func NewGroupBranchProtection(ctx *Context, name string, args GroupBranchProtectionArgs, opts ...ResourceOption) (*GroupBranchProtection, error)public GroupBranchProtection(string name, GroupBranchProtectionArgs args, CustomResourceOptions? opts = null)
public GroupBranchProtection(String name, GroupBranchProtectionArgs args)
public GroupBranchProtection(String name, GroupBranchProtectionArgs args, CustomResourceOptions options)
type: gitlab:GroupBranchProtection
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "gitlab_groupbranchprotection" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args GroupBranchProtectionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args GroupBranchProtectionArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args GroupBranchProtectionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args GroupBranchProtectionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args GroupBranchProtectionArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var groupBranchProtectionResource = new GitLab.GroupBranchProtection("groupBranchProtectionResource", new()
{
Branch = "string",
Group = "string",
AllowForcePush = false,
AllowedToMerges = new[]
{
new GitLab.Inputs.GroupBranchProtectionAllowedToMergeArgs
{
AccessLevel = "string",
AccessLevelDescription = "string",
GroupId = 0,
UserId = 0,
},
},
AllowedToPushes = new[]
{
new GitLab.Inputs.GroupBranchProtectionAllowedToPushArgs
{
AccessLevel = "string",
AccessLevelDescription = "string",
DeployKeyId = 0,
GroupId = 0,
UserId = 0,
},
},
AllowedToUnprotects = new[]
{
new GitLab.Inputs.GroupBranchProtectionAllowedToUnprotectArgs
{
AccessLevel = "string",
AccessLevelDescription = "string",
GroupId = 0,
UserId = 0,
},
},
CodeOwnerApprovalRequired = false,
});
example, err := gitlab.NewGroupBranchProtection(ctx, "groupBranchProtectionResource", &gitlab.GroupBranchProtectionArgs{
Branch: pulumi.String("string"),
Group: pulumi.String("string"),
AllowForcePush: pulumi.Bool(false),
AllowedToMerges: gitlab.GroupBranchProtectionAllowedToMergeArray{
&gitlab.GroupBranchProtectionAllowedToMergeArgs{
AccessLevel: pulumi.String("string"),
AccessLevelDescription: pulumi.String("string"),
GroupId: pulumi.Int(0),
UserId: pulumi.Int(0),
},
},
AllowedToPushes: gitlab.GroupBranchProtectionAllowedToPushArray{
&gitlab.GroupBranchProtectionAllowedToPushArgs{
AccessLevel: pulumi.String("string"),
AccessLevelDescription: pulumi.String("string"),
DeployKeyId: pulumi.Int(0),
GroupId: pulumi.Int(0),
UserId: pulumi.Int(0),
},
},
AllowedToUnprotects: gitlab.GroupBranchProtectionAllowedToUnprotectArray{
&gitlab.GroupBranchProtectionAllowedToUnprotectArgs{
AccessLevel: pulumi.String("string"),
AccessLevelDescription: pulumi.String("string"),
GroupId: pulumi.Int(0),
UserId: pulumi.Int(0),
},
},
CodeOwnerApprovalRequired: pulumi.Bool(false),
})
resource "gitlab_groupbranchprotection" "groupBranchProtectionResource" {
branch = "string"
group = "string"
allow_force_push = false
allowed_to_merges {
access_level = "string"
access_level_description = "string"
group_id = 0
user_id = 0
}
allowed_to_pushes {
access_level = "string"
access_level_description = "string"
deploy_key_id = 0
group_id = 0
user_id = 0
}
allowed_to_unprotects {
access_level = "string"
access_level_description = "string"
group_id = 0
user_id = 0
}
code_owner_approval_required = false
}
var groupBranchProtectionResource = new GroupBranchProtection("groupBranchProtectionResource", GroupBranchProtectionArgs.builder()
.branch("string")
.group("string")
.allowForcePush(false)
.allowedToMerges(GroupBranchProtectionAllowedToMergeArgs.builder()
.accessLevel("string")
.accessLevelDescription("string")
.groupId(0)
.userId(0)
.build())
.allowedToPushes(GroupBranchProtectionAllowedToPushArgs.builder()
.accessLevel("string")
.accessLevelDescription("string")
.deployKeyId(0)
.groupId(0)
.userId(0)
.build())
.allowedToUnprotects(GroupBranchProtectionAllowedToUnprotectArgs.builder()
.accessLevel("string")
.accessLevelDescription("string")
.groupId(0)
.userId(0)
.build())
.codeOwnerApprovalRequired(false)
.build());
group_branch_protection_resource = gitlab.GroupBranchProtection("groupBranchProtectionResource",
branch="string",
group="string",
allow_force_push=False,
allowed_to_merges=[{
"access_level": "string",
"access_level_description": "string",
"group_id": 0,
"user_id": 0,
}],
allowed_to_pushes=[{
"access_level": "string",
"access_level_description": "string",
"deploy_key_id": 0,
"group_id": 0,
"user_id": 0,
}],
allowed_to_unprotects=[{
"access_level": "string",
"access_level_description": "string",
"group_id": 0,
"user_id": 0,
}],
code_owner_approval_required=False)
const groupBranchProtectionResource = new gitlab.GroupBranchProtection("groupBranchProtectionResource", {
branch: "string",
group: "string",
allowForcePush: false,
allowedToMerges: [{
accessLevel: "string",
accessLevelDescription: "string",
groupId: 0,
userId: 0,
}],
allowedToPushes: [{
accessLevel: "string",
accessLevelDescription: "string",
deployKeyId: 0,
groupId: 0,
userId: 0,
}],
allowedToUnprotects: [{
accessLevel: "string",
accessLevelDescription: "string",
groupId: 0,
userId: 0,
}],
codeOwnerApprovalRequired: false,
});
type: gitlab:GroupBranchProtection
properties:
allowForcePush: false
allowedToMerges:
- accessLevel: string
accessLevelDescription: string
groupId: 0
userId: 0
allowedToPushes:
- accessLevel: string
accessLevelDescription: string
deployKeyId: 0
groupId: 0
userId: 0
allowedToUnprotects:
- accessLevel: string
accessLevelDescription: string
groupId: 0
userId: 0
branch: string
codeOwnerApprovalRequired: false
group: string
GroupBranchProtection Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The GroupBranchProtection resource accepts the following input properties:
- Branch string
- Name of the branch or wildcard.
- Group string
- The id or URL-encoded path of the group.
- Allow
Force boolPush - Can be set to true to allow users with push access to force push.
- Allowed
To List<Pulumi.Merges Git Lab. Inputs. Group Branch Protection Allowed To Merge> - Array of merge access levels/users/groups allowed for the group-level protected branch.
- Allowed
To List<Pulumi.Pushes Git Lab. Inputs. Group Branch Protection Allowed To Push> - Array of push access levels/users/groups/deploy keys allowed for the group-level protected branch.
- Allowed
To List<Pulumi.Unprotects Git Lab. Inputs. Group Branch Protection Allowed To Unprotect> - Array of unprotect access levels/users/groups allowed for the group-level protected branch.
- Code
Owner boolApproval Required - Can be set to true to require code owner approval before merging.
- Branch string
- Name of the branch or wildcard.
- Group string
- The id or URL-encoded path of the group.
- Allow
Force boolPush - Can be set to true to allow users with push access to force push.
- Allowed
To []GroupMerges Branch Protection Allowed To Merge Args - Array of merge access levels/users/groups allowed for the group-level protected branch.
- Allowed
To []GroupPushes Branch Protection Allowed To Push Args - Array of push access levels/users/groups/deploy keys allowed for the group-level protected branch.
- Allowed
To []GroupUnprotects Branch Protection Allowed To Unprotect Args - Array of unprotect access levels/users/groups allowed for the group-level protected branch.
- Code
Owner boolApproval Required - Can be set to true to require code owner approval before merging.
- branch string
- Name of the branch or wildcard.
- group string
- The id or URL-encoded path of the group.
- allow_
force_ boolpush - Can be set to true to allow users with push access to force push.
- allowed_
to_ list(object)merges - Array of merge access levels/users/groups allowed for the group-level protected branch.
- allowed_
to_ list(object)pushes - Array of push access levels/users/groups/deploy keys allowed for the group-level protected branch.
- allowed_
to_ list(object)unprotects - Array of unprotect access levels/users/groups allowed for the group-level protected branch.
- code_
owner_ boolapproval_ required - Can be set to true to require code owner approval before merging.
- branch String
- Name of the branch or wildcard.
- group String
- The id or URL-encoded path of the group.
- allow
Force BooleanPush - Can be set to true to allow users with push access to force push.
- allowed
To List<GroupMerges Branch Protection Allowed To Merge> - Array of merge access levels/users/groups allowed for the group-level protected branch.
- allowed
To List<GroupPushes Branch Protection Allowed To Push> - Array of push access levels/users/groups/deploy keys allowed for the group-level protected branch.
- allowed
To List<GroupUnprotects Branch Protection Allowed To Unprotect> - Array of unprotect access levels/users/groups allowed for the group-level protected branch.
- code
Owner BooleanApproval Required - Can be set to true to require code owner approval before merging.
- branch string
- Name of the branch or wildcard.
- group string
- The id or URL-encoded path of the group.
- allow
Force booleanPush - Can be set to true to allow users with push access to force push.
- allowed
To GroupMerges Branch Protection Allowed To Merge[] - Array of merge access levels/users/groups allowed for the group-level protected branch.
- allowed
To GroupPushes Branch Protection Allowed To Push[] - Array of push access levels/users/groups/deploy keys allowed for the group-level protected branch.
- allowed
To GroupUnprotects Branch Protection Allowed To Unprotect[] - Array of unprotect access levels/users/groups allowed for the group-level protected branch.
- code
Owner booleanApproval Required - Can be set to true to require code owner approval before merging.
- branch str
- Name of the branch or wildcard.
- group str
- The id or URL-encoded path of the group.
- allow_
force_ boolpush - Can be set to true to allow users with push access to force push.
- allowed_
to_ Sequence[Groupmerges Branch Protection Allowed To Merge Args] - Array of merge access levels/users/groups allowed for the group-level protected branch.
- allowed_
to_ Sequence[Grouppushes Branch Protection Allowed To Push Args] - Array of push access levels/users/groups/deploy keys allowed for the group-level protected branch.
- allowed_
to_ Sequence[Groupunprotects Branch Protection Allowed To Unprotect Args] - Array of unprotect access levels/users/groups allowed for the group-level protected branch.
- code_
owner_ boolapproval_ required - Can be set to true to require code owner approval before merging.
- branch String
- Name of the branch or wildcard.
- group String
- The id or URL-encoded path of the group.
- allow
Force BooleanPush - Can be set to true to allow users with push access to force push.
- allowed
To List<Property Map>Merges - Array of merge access levels/users/groups allowed for the group-level protected branch.
- allowed
To List<Property Map>Pushes - Array of push access levels/users/groups/deploy keys allowed for the group-level protected branch.
- allowed
To List<Property Map>Unprotects - Array of unprotect access levels/users/groups allowed for the group-level protected branch.
- code
Owner BooleanApproval Required - Can be set to true to require code owner approval before merging.
Outputs
All input properties are implicitly available as output properties. Additionally, the GroupBranchProtection resource produces the following output properties:
- Branch
Protection intId - The ID of the branch protection (not the branch name).
- Id string
- The provider-assigned unique ID for this managed resource.
- Branch
Protection intId - The ID of the branch protection (not the branch name).
- Id string
- The provider-assigned unique ID for this managed resource.
- branch_
protection_ numberid - The ID of the branch protection (not the branch name).
- id string
- The provider-assigned unique ID for this managed resource.
- branch
Protection IntegerId - The ID of the branch protection (not the branch name).
- id String
- The provider-assigned unique ID for this managed resource.
- branch
Protection numberId - The ID of the branch protection (not the branch name).
- id string
- The provider-assigned unique ID for this managed resource.
- branch_
protection_ intid - The ID of the branch protection (not the branch name).
- id str
- The provider-assigned unique ID for this managed resource.
- branch
Protection NumberId - The ID of the branch protection (not the branch name).
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing GroupBranchProtection Resource
Get an existing GroupBranchProtection resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: GroupBranchProtectionState, opts?: CustomResourceOptions): GroupBranchProtection@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
allow_force_push: Optional[bool] = None,
allowed_to_merges: Optional[Sequence[GroupBranchProtectionAllowedToMergeArgs]] = None,
allowed_to_pushes: Optional[Sequence[GroupBranchProtectionAllowedToPushArgs]] = None,
allowed_to_unprotects: Optional[Sequence[GroupBranchProtectionAllowedToUnprotectArgs]] = None,
branch: Optional[str] = None,
branch_protection_id: Optional[int] = None,
code_owner_approval_required: Optional[bool] = None,
group: Optional[str] = None) -> GroupBranchProtectionfunc GetGroupBranchProtection(ctx *Context, name string, id IDInput, state *GroupBranchProtectionState, opts ...ResourceOption) (*GroupBranchProtection, error)public static GroupBranchProtection Get(string name, Input<string> id, GroupBranchProtectionState? state, CustomResourceOptions? opts = null)public static GroupBranchProtection get(String name, Output<String> id, GroupBranchProtectionState state, CustomResourceOptions options)resources: _: type: gitlab:GroupBranchProtection get: id: ${id}import {
to = gitlab_groupbranchprotection.example
id = "${id}"
}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Allow
Force boolPush - Can be set to true to allow users with push access to force push.
- Allowed
To List<Pulumi.Merges Git Lab. Inputs. Group Branch Protection Allowed To Merge> - Array of merge access levels/users/groups allowed for the group-level protected branch.
- Allowed
To List<Pulumi.Pushes Git Lab. Inputs. Group Branch Protection Allowed To Push> - Array of push access levels/users/groups/deploy keys allowed for the group-level protected branch.
- Allowed
To List<Pulumi.Unprotects Git Lab. Inputs. Group Branch Protection Allowed To Unprotect> - Array of unprotect access levels/users/groups allowed for the group-level protected branch.
- Branch string
- Name of the branch or wildcard.
- Branch
Protection intId - The ID of the branch protection (not the branch name).
- Code
Owner boolApproval Required - Can be set to true to require code owner approval before merging.
- Group string
- The id or URL-encoded path of the group.
- Allow
Force boolPush - Can be set to true to allow users with push access to force push.
- Allowed
To []GroupMerges Branch Protection Allowed To Merge Args - Array of merge access levels/users/groups allowed for the group-level protected branch.
- Allowed
To []GroupPushes Branch Protection Allowed To Push Args - Array of push access levels/users/groups/deploy keys allowed for the group-level protected branch.
- Allowed
To []GroupUnprotects Branch Protection Allowed To Unprotect Args - Array of unprotect access levels/users/groups allowed for the group-level protected branch.
- Branch string
- Name of the branch or wildcard.
- Branch
Protection intId - The ID of the branch protection (not the branch name).
- Code
Owner boolApproval Required - Can be set to true to require code owner approval before merging.
- Group string
- The id or URL-encoded path of the group.
- allow_
force_ boolpush - Can be set to true to allow users with push access to force push.
- allowed_
to_ list(object)merges - Array of merge access levels/users/groups allowed for the group-level protected branch.
- allowed_
to_ list(object)pushes - Array of push access levels/users/groups/deploy keys allowed for the group-level protected branch.
- allowed_
to_ list(object)unprotects - Array of unprotect access levels/users/groups allowed for the group-level protected branch.
- branch string
- Name of the branch or wildcard.
- branch_
protection_ numberid - The ID of the branch protection (not the branch name).
- code_
owner_ boolapproval_ required - Can be set to true to require code owner approval before merging.
- group string
- The id or URL-encoded path of the group.
- allow
Force BooleanPush - Can be set to true to allow users with push access to force push.
- allowed
To List<GroupMerges Branch Protection Allowed To Merge> - Array of merge access levels/users/groups allowed for the group-level protected branch.
- allowed
To List<GroupPushes Branch Protection Allowed To Push> - Array of push access levels/users/groups/deploy keys allowed for the group-level protected branch.
- allowed
To List<GroupUnprotects Branch Protection Allowed To Unprotect> - Array of unprotect access levels/users/groups allowed for the group-level protected branch.
- branch String
- Name of the branch or wildcard.
- branch
Protection IntegerId - The ID of the branch protection (not the branch name).
- code
Owner BooleanApproval Required - Can be set to true to require code owner approval before merging.
- group String
- The id or URL-encoded path of the group.
- allow
Force booleanPush - Can be set to true to allow users with push access to force push.
- allowed
To GroupMerges Branch Protection Allowed To Merge[] - Array of merge access levels/users/groups allowed for the group-level protected branch.
- allowed
To GroupPushes Branch Protection Allowed To Push[] - Array of push access levels/users/groups/deploy keys allowed for the group-level protected branch.
- allowed
To GroupUnprotects Branch Protection Allowed To Unprotect[] - Array of unprotect access levels/users/groups allowed for the group-level protected branch.
- branch string
- Name of the branch or wildcard.
- branch
Protection numberId - The ID of the branch protection (not the branch name).
- code
Owner booleanApproval Required - Can be set to true to require code owner approval before merging.
- group string
- The id or URL-encoded path of the group.
- allow_
force_ boolpush - Can be set to true to allow users with push access to force push.
- allowed_
to_ Sequence[Groupmerges Branch Protection Allowed To Merge Args] - Array of merge access levels/users/groups allowed for the group-level protected branch.
- allowed_
to_ Sequence[Grouppushes Branch Protection Allowed To Push Args] - Array of push access levels/users/groups/deploy keys allowed for the group-level protected branch.
- allowed_
to_ Sequence[Groupunprotects Branch Protection Allowed To Unprotect Args] - Array of unprotect access levels/users/groups allowed for the group-level protected branch.
- branch str
- Name of the branch or wildcard.
- branch_
protection_ intid - The ID of the branch protection (not the branch name).
- code_
owner_ boolapproval_ required - Can be set to true to require code owner approval before merging.
- group str
- The id or URL-encoded path of the group.
- allow
Force BooleanPush - Can be set to true to allow users with push access to force push.
- allowed
To List<Property Map>Merges - Array of merge access levels/users/groups allowed for the group-level protected branch.
- allowed
To List<Property Map>Pushes - Array of push access levels/users/groups/deploy keys allowed for the group-level protected branch.
- allowed
To List<Property Map>Unprotects - Array of unprotect access levels/users/groups allowed for the group-level protected branch.
- branch String
- Name of the branch or wildcard.
- branch
Protection NumberId - The ID of the branch protection (not the branch name).
- code
Owner BooleanApproval Required - Can be set to true to require code owner approval before merging.
- group String
- The id or URL-encoded path of the group.
Supporting Types
GroupBranchProtectionAllowedToMerge, GroupBranchProtectionAllowedToMergeArgs
- Access
Level string - Access level allowed to perform the relevant action. Mutually exclusive with
groupIdanduserId. Valid values are:no one,developer,maintainer,admin. - Access
Level stringDescription - Readable description of access level.
- Group
Id int - The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with
userIdandaccessLevel. - User
Id int - The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with
groupIdandaccessLevel.
- Access
Level string - Access level allowed to perform the relevant action. Mutually exclusive with
groupIdanduserId. Valid values are:no one,developer,maintainer,admin. - Access
Level stringDescription - Readable description of access level.
- Group
Id int - The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with
userIdandaccessLevel. - User
Id int - The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with
groupIdandaccessLevel.
- access_
level string - Access level allowed to perform the relevant action. Mutually exclusive with
groupIdanduserId. Valid values are:no one,developer,maintainer,admin. - access_
level_ stringdescription - Readable description of access level.
- group_
id number - The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with
userIdandaccessLevel. - user_
id number - The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with
groupIdandaccessLevel.
- access
Level String - Access level allowed to perform the relevant action. Mutually exclusive with
groupIdanduserId. Valid values are:no one,developer,maintainer,admin. - access
Level StringDescription - Readable description of access level.
- group
Id Integer - The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with
userIdandaccessLevel. - user
Id Integer - The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with
groupIdandaccessLevel.
- access
Level string - Access level allowed to perform the relevant action. Mutually exclusive with
groupIdanduserId. Valid values are:no one,developer,maintainer,admin. - access
Level stringDescription - Readable description of access level.
- group
Id number - The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with
userIdandaccessLevel. - user
Id number - The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with
groupIdandaccessLevel.
- access_
level str - Access level allowed to perform the relevant action. Mutually exclusive with
groupIdanduserId. Valid values are:no one,developer,maintainer,admin. - access_
level_ strdescription - Readable description of access level.
- group_
id int - The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with
userIdandaccessLevel. - user_
id int - The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with
groupIdandaccessLevel.
- access
Level String - Access level allowed to perform the relevant action. Mutually exclusive with
groupIdanduserId. Valid values are:no one,developer,maintainer,admin. - access
Level StringDescription - Readable description of access level.
- group
Id Number - The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with
userIdandaccessLevel. - user
Id Number - The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with
groupIdandaccessLevel.
GroupBranchProtectionAllowedToPush, GroupBranchProtectionAllowedToPushArgs
- Access
Level string - Access level allowed to perform the relevant action. Mutually exclusive with
deployKeyId,groupId, anduserId. Valid values are:no one,developer,maintainer,admin. - Access
Level stringDescription - Readable description of access level.
- Deploy
Key intId - The ID of a GitLab deploy key allowed to perform the relevant action. Mutually exclusive with
userId,groupId, andaccessLevel. - Group
Id int - The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with
deployKeyId,userId, andaccessLevel. - User
Id int - The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with
deployKeyId,groupId, andaccessLevel.
- Access
Level string - Access level allowed to perform the relevant action. Mutually exclusive with
deployKeyId,groupId, anduserId. Valid values are:no one,developer,maintainer,admin. - Access
Level stringDescription - Readable description of access level.
- Deploy
Key intId - The ID of a GitLab deploy key allowed to perform the relevant action. Mutually exclusive with
userId,groupId, andaccessLevel. - Group
Id int - The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with
deployKeyId,userId, andaccessLevel. - User
Id int - The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with
deployKeyId,groupId, andaccessLevel.
- access_
level string - Access level allowed to perform the relevant action. Mutually exclusive with
deployKeyId,groupId, anduserId. Valid values are:no one,developer,maintainer,admin. - access_
level_ stringdescription - Readable description of access level.
- deploy_
key_ numberid - The ID of a GitLab deploy key allowed to perform the relevant action. Mutually exclusive with
userId,groupId, andaccessLevel. - group_
id number - The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with
deployKeyId,userId, andaccessLevel. - user_
id number - The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with
deployKeyId,groupId, andaccessLevel.
- access
Level String - Access level allowed to perform the relevant action. Mutually exclusive with
deployKeyId,groupId, anduserId. Valid values are:no one,developer,maintainer,admin. - access
Level StringDescription - Readable description of access level.
- deploy
Key IntegerId - The ID of a GitLab deploy key allowed to perform the relevant action. Mutually exclusive with
userId,groupId, andaccessLevel. - group
Id Integer - The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with
deployKeyId,userId, andaccessLevel. - user
Id Integer - The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with
deployKeyId,groupId, andaccessLevel.
- access
Level string - Access level allowed to perform the relevant action. Mutually exclusive with
deployKeyId,groupId, anduserId. Valid values are:no one,developer,maintainer,admin. - access
Level stringDescription - Readable description of access level.
- deploy
Key numberId - The ID of a GitLab deploy key allowed to perform the relevant action. Mutually exclusive with
userId,groupId, andaccessLevel. - group
Id number - The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with
deployKeyId,userId, andaccessLevel. - user
Id number - The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with
deployKeyId,groupId, andaccessLevel.
- access_
level str - Access level allowed to perform the relevant action. Mutually exclusive with
deployKeyId,groupId, anduserId. Valid values are:no one,developer,maintainer,admin. - access_
level_ strdescription - Readable description of access level.
- deploy_
key_ intid - The ID of a GitLab deploy key allowed to perform the relevant action. Mutually exclusive with
userId,groupId, andaccessLevel. - group_
id int - The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with
deployKeyId,userId, andaccessLevel. - user_
id int - The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with
deployKeyId,groupId, andaccessLevel.
- access
Level String - Access level allowed to perform the relevant action. Mutually exclusive with
deployKeyId,groupId, anduserId. Valid values are:no one,developer,maintainer,admin. - access
Level StringDescription - Readable description of access level.
- deploy
Key NumberId - The ID of a GitLab deploy key allowed to perform the relevant action. Mutually exclusive with
userId,groupId, andaccessLevel. - group
Id Number - The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with
deployKeyId,userId, andaccessLevel. - user
Id Number - The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with
deployKeyId,groupId, andaccessLevel.
GroupBranchProtectionAllowedToUnprotect, GroupBranchProtectionAllowedToUnprotectArgs
- Access
Level string - Access level allowed to perform the relevant action. Mutually exclusive with
groupIdanduserId. Valid values are:developer,maintainer,admin. - Access
Level stringDescription - Readable description of access level.
- Group
Id int - The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with
userIdandaccessLevel. - User
Id int - The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with
groupIdandaccessLevel.
- Access
Level string - Access level allowed to perform the relevant action. Mutually exclusive with
groupIdanduserId. Valid values are:developer,maintainer,admin. - Access
Level stringDescription - Readable description of access level.
- Group
Id int - The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with
userIdandaccessLevel. - User
Id int - The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with
groupIdandaccessLevel.
- access_
level string - Access level allowed to perform the relevant action. Mutually exclusive with
groupIdanduserId. Valid values are:developer,maintainer,admin. - access_
level_ stringdescription - Readable description of access level.
- group_
id number - The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with
userIdandaccessLevel. - user_
id number - The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with
groupIdandaccessLevel.
- access
Level String - Access level allowed to perform the relevant action. Mutually exclusive with
groupIdanduserId. Valid values are:developer,maintainer,admin. - access
Level StringDescription - Readable description of access level.
- group
Id Integer - The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with
userIdandaccessLevel. - user
Id Integer - The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with
groupIdandaccessLevel.
- access
Level string - Access level allowed to perform the relevant action. Mutually exclusive with
groupIdanduserId. Valid values are:developer,maintainer,admin. - access
Level stringDescription - Readable description of access level.
- group
Id number - The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with
userIdandaccessLevel. - user
Id number - The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with
groupIdandaccessLevel.
- access_
level str - Access level allowed to perform the relevant action. Mutually exclusive with
groupIdanduserId. Valid values are:developer,maintainer,admin. - access_
level_ strdescription - Readable description of access level.
- group_
id int - The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with
userIdandaccessLevel. - user_
id int - The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with
groupIdandaccessLevel.
- access
Level String - Access level allowed to perform the relevant action. Mutually exclusive with
groupIdanduserId. Valid values are:developer,maintainer,admin. - access
Level StringDescription - Readable description of access level.
- group
Id Number - The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with
userIdandaccessLevel. - user
Id Number - The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with
groupIdandaccessLevel.
Import
Starting in Terraform v1.5.0, you can use an import block to import gitlab.GroupBranchProtection. For example:
Importing using the CLI is supported with the following syntax:
GitLab group-level branch protections can be imported with a key composed of <group-id>:<branch>, for example:
$ pulumi import gitlab:index/groupBranchProtection:GroupBranchProtection main "12345:main"
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- GitLab pulumi/pulumi-gitlab
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
gitlabTerraform Provider.
published on Friday, Jun 26, 2026 by Pulumi