1. Packages
  2. Packages
  3. Gitlab Provider
  4. API Docs
  5. getGroupProtectedBranch
Viewing docs for GitLab v10.0.0
published on Friday, Jun 26, 2026 by Pulumi
gitlab logo
Viewing docs for GitLab v10.0.0
published on Friday, Jun 26, 2026 by Pulumi

    The gitlab.getGroupProtectedBranch data source allows details of a group-level protected branch to be retrieved by its name and the group it belongs to.

    This data source requires a GitLab Premium or Ultimate instance.

    Upstream API: GitLab REST API docs

    Using getGroupProtectedBranch

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getGroupProtectedBranch(args: GetGroupProtectedBranchArgs, opts?: InvokeOptions): Promise<GetGroupProtectedBranchResult>
    function getGroupProtectedBranchOutput(args: GetGroupProtectedBranchOutputArgs, opts?: InvokeOptions): Output<GetGroupProtectedBranchResult>
    def get_group_protected_branch(group: Optional[str] = None,
                                   name: Optional[str] = None,
                                   opts: Optional[InvokeOptions] = None) -> GetGroupProtectedBranchResult
    def get_group_protected_branch_output(group: pulumi.Input[Optional[str]] = None,
                                   name: pulumi.Input[Optional[str]] = None,
                                   opts: Optional[InvokeOptions] = None) -> Output[GetGroupProtectedBranchResult]
    func GetGroupProtectedBranch(ctx *Context, args *GetGroupProtectedBranchArgs, opts ...InvokeOption) (*GetGroupProtectedBranchResult, error)
    func GetGroupProtectedBranchOutput(ctx *Context, args *GetGroupProtectedBranchOutputArgs, opts ...InvokeOption) GetGroupProtectedBranchResultOutput

    > Note: This function is named GetGroupProtectedBranch in the Go SDK.

    public static class GetGroupProtectedBranch 
    {
        public static Task<GetGroupProtectedBranchResult> InvokeAsync(GetGroupProtectedBranchArgs args, InvokeOptions? opts = null)
        public static Output<GetGroupProtectedBranchResult> Invoke(GetGroupProtectedBranchInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetGroupProtectedBranchResult> getGroupProtectedBranch(GetGroupProtectedBranchArgs args, InvokeOptions options)
    public static Output<GetGroupProtectedBranchResult> getGroupProtectedBranch(GetGroupProtectedBranchArgs args, InvokeOptions options)
    
    fn::invoke:
      function: gitlab:index/getGroupProtectedBranch:getGroupProtectedBranch
      arguments:
        # arguments dictionary
    data "gitlab_getgroupprotectedbranch" "name" {
        # arguments
    }

    The following arguments are supported:

    Group string
    The integer or URL-encoded path of the group.
    Name string
    The name of the protected branch.
    Group string
    The integer or URL-encoded path of the group.
    Name string
    The name of the protected branch.
    group string
    The integer or URL-encoded path of the group.
    name string
    The name of the protected branch.
    group String
    The integer or URL-encoded path of the group.
    name String
    The name of the protected branch.
    group string
    The integer or URL-encoded path of the group.
    name string
    The name of the protected branch.
    group str
    The integer or URL-encoded path of the group.
    name str
    The name of the protected branch.
    group String
    The integer or URL-encoded path of the group.
    name String
    The name of the protected branch.

    getGroupProtectedBranch Result

    The following output properties are available:

    AllowForcePush bool
    Whether force push is allowed.
    CodeOwnerApprovalRequired bool
    Reject code pushes that change files listed in the CODEOWNERS file.
    Group string
    The integer or URL-encoded path of the group.
    Id int
    The ID of this resource.
    MergeAccessLevels List<Pulumi.GitLab.Outputs.GetGroupProtectedBranchMergeAccessLevel>
    Array of merge access levels/users/groups allowed for the protected branch.
    Name string
    The name of the protected branch.
    PushAccessLevels List<Pulumi.GitLab.Outputs.GetGroupProtectedBranchPushAccessLevel>
    Array of push access levels/users/groups/deploy keys allowed for the protected branch.
    UnprotectAccessLevels List<Pulumi.GitLab.Outputs.GetGroupProtectedBranchUnprotectAccessLevel>
    Array of unprotect access levels/users/groups allowed for the protected branch.
    AllowForcePush bool
    Whether force push is allowed.
    CodeOwnerApprovalRequired bool
    Reject code pushes that change files listed in the CODEOWNERS file.
    Group string
    The integer or URL-encoded path of the group.
    Id int
    The ID of this resource.
    MergeAccessLevels []GetGroupProtectedBranchMergeAccessLevel
    Array of merge access levels/users/groups allowed for the protected branch.
    Name string
    The name of the protected branch.
    PushAccessLevels []GetGroupProtectedBranchPushAccessLevel
    Array of push access levels/users/groups/deploy keys allowed for the protected branch.
    UnprotectAccessLevels []GetGroupProtectedBranchUnprotectAccessLevel
    Array of unprotect access levels/users/groups allowed for the protected branch.
    allow_force_push bool
    Whether force push is allowed.
    code_owner_approval_required bool
    Reject code pushes that change files listed in the CODEOWNERS file.
    group string
    The integer or URL-encoded path of the group.
    id number
    The ID of this resource.
    merge_access_levels list(object)
    Array of merge access levels/users/groups allowed for the protected branch.
    name string
    The name of the protected branch.
    push_access_levels list(object)
    Array of push access levels/users/groups/deploy keys allowed for the protected branch.
    unprotect_access_levels list(object)
    Array of unprotect access levels/users/groups allowed for the protected branch.
    allowForcePush Boolean
    Whether force push is allowed.
    codeOwnerApprovalRequired Boolean
    Reject code pushes that change files listed in the CODEOWNERS file.
    group String
    The integer or URL-encoded path of the group.
    id Integer
    The ID of this resource.
    mergeAccessLevels List<GetGroupProtectedBranchMergeAccessLevel>
    Array of merge access levels/users/groups allowed for the protected branch.
    name String
    The name of the protected branch.
    pushAccessLevels List<GetGroupProtectedBranchPushAccessLevel>
    Array of push access levels/users/groups/deploy keys allowed for the protected branch.
    unprotectAccessLevels List<GetGroupProtectedBranchUnprotectAccessLevel>
    Array of unprotect access levels/users/groups allowed for the protected branch.
    allowForcePush boolean
    Whether force push is allowed.
    codeOwnerApprovalRequired boolean
    Reject code pushes that change files listed in the CODEOWNERS file.
    group string
    The integer or URL-encoded path of the group.
    id number
    The ID of this resource.
    mergeAccessLevels GetGroupProtectedBranchMergeAccessLevel[]
    Array of merge access levels/users/groups allowed for the protected branch.
    name string
    The name of the protected branch.
    pushAccessLevels GetGroupProtectedBranchPushAccessLevel[]
    Array of push access levels/users/groups/deploy keys allowed for the protected branch.
    unprotectAccessLevels GetGroupProtectedBranchUnprotectAccessLevel[]
    Array of unprotect access levels/users/groups allowed for the protected branch.
    allow_force_push bool
    Whether force push is allowed.
    code_owner_approval_required bool
    Reject code pushes that change files listed in the CODEOWNERS file.
    group str
    The integer or URL-encoded path of the group.
    id int
    The ID of this resource.
    merge_access_levels Sequence[GetGroupProtectedBranchMergeAccessLevel]
    Array of merge access levels/users/groups allowed for the protected branch.
    name str
    The name of the protected branch.
    push_access_levels Sequence[GetGroupProtectedBranchPushAccessLevel]
    Array of push access levels/users/groups/deploy keys allowed for the protected branch.
    unprotect_access_levels Sequence[GetGroupProtectedBranchUnprotectAccessLevel]
    Array of unprotect access levels/users/groups allowed for the protected branch.
    allowForcePush Boolean
    Whether force push is allowed.
    codeOwnerApprovalRequired Boolean
    Reject code pushes that change files listed in the CODEOWNERS file.
    group String
    The integer or URL-encoded path of the group.
    id Number
    The ID of this resource.
    mergeAccessLevels List<Property Map>
    Array of merge access levels/users/groups allowed for the protected branch.
    name String
    The name of the protected branch.
    pushAccessLevels List<Property Map>
    Array of push access levels/users/groups/deploy keys allowed for the protected branch.
    unprotectAccessLevels List<Property Map>
    Array of unprotect access levels/users/groups allowed for the protected branch.

    Supporting Types

    GetGroupProtectedBranchMergeAccessLevel

    AccessLevel string
    Access level allowed to perform the relevant action.
    AccessLevelDescription string
    Readable description of access level.
    GroupId int
    The ID of a GitLab group allowed to perform the relevant action.
    UserId int
    The ID of a GitLab user allowed to perform the relevant action.
    AccessLevel string
    Access level allowed to perform the relevant action.
    AccessLevelDescription string
    Readable description of access level.
    GroupId int
    The ID of a GitLab group allowed to perform the relevant action.
    UserId int
    The ID of a GitLab user allowed to perform the relevant action.
    access_level string
    Access level allowed to perform the relevant action.
    access_level_description string
    Readable description of access level.
    group_id number
    The ID of a GitLab group allowed to perform the relevant action.
    user_id number
    The ID of a GitLab user allowed to perform the relevant action.
    accessLevel String
    Access level allowed to perform the relevant action.
    accessLevelDescription String
    Readable description of access level.
    groupId Integer
    The ID of a GitLab group allowed to perform the relevant action.
    userId Integer
    The ID of a GitLab user allowed to perform the relevant action.
    accessLevel string
    Access level allowed to perform the relevant action.
    accessLevelDescription string
    Readable description of access level.
    groupId number
    The ID of a GitLab group allowed to perform the relevant action.
    userId number
    The ID of a GitLab user allowed to perform the relevant action.
    access_level str
    Access level allowed to perform the relevant action.
    access_level_description str
    Readable description of access level.
    group_id int
    The ID of a GitLab group allowed to perform the relevant action.
    user_id int
    The ID of a GitLab user allowed to perform the relevant action.
    accessLevel String
    Access level allowed to perform the relevant action.
    accessLevelDescription String
    Readable description of access level.
    groupId Number
    The ID of a GitLab group allowed to perform the relevant action.
    userId Number
    The ID of a GitLab user allowed to perform the relevant action.

    GetGroupProtectedBranchPushAccessLevel

    AccessLevel string
    Access level allowed to perform the relevant action.
    AccessLevelDescription string
    Readable description of access level.
    DeployKeyId int
    The ID of a GitLab deploy key allowed to perform the relevant action.
    GroupId int
    The ID of a GitLab group allowed to perform the relevant action.
    UserId int
    The ID of a GitLab user allowed to perform the relevant action.
    AccessLevel string
    Access level allowed to perform the relevant action.
    AccessLevelDescription string
    Readable description of access level.
    DeployKeyId int
    The ID of a GitLab deploy key allowed to perform the relevant action.
    GroupId int
    The ID of a GitLab group allowed to perform the relevant action.
    UserId int
    The ID of a GitLab user allowed to perform the relevant action.
    access_level string
    Access level allowed to perform the relevant action.
    access_level_description string
    Readable description of access level.
    deploy_key_id number
    The ID of a GitLab deploy key allowed to perform the relevant action.
    group_id number
    The ID of a GitLab group allowed to perform the relevant action.
    user_id number
    The ID of a GitLab user allowed to perform the relevant action.
    accessLevel String
    Access level allowed to perform the relevant action.
    accessLevelDescription String
    Readable description of access level.
    deployKeyId Integer
    The ID of a GitLab deploy key allowed to perform the relevant action.
    groupId Integer
    The ID of a GitLab group allowed to perform the relevant action.
    userId Integer
    The ID of a GitLab user allowed to perform the relevant action.
    accessLevel string
    Access level allowed to perform the relevant action.
    accessLevelDescription string
    Readable description of access level.
    deployKeyId number
    The ID of a GitLab deploy key allowed to perform the relevant action.
    groupId number
    The ID of a GitLab group allowed to perform the relevant action.
    userId number
    The ID of a GitLab user allowed to perform the relevant action.
    access_level str
    Access level allowed to perform the relevant action.
    access_level_description str
    Readable description of access level.
    deploy_key_id int
    The ID of a GitLab deploy key allowed to perform the relevant action.
    group_id int
    The ID of a GitLab group allowed to perform the relevant action.
    user_id int
    The ID of a GitLab user allowed to perform the relevant action.
    accessLevel String
    Access level allowed to perform the relevant action.
    accessLevelDescription String
    Readable description of access level.
    deployKeyId Number
    The ID of a GitLab deploy key allowed to perform the relevant action.
    groupId Number
    The ID of a GitLab group allowed to perform the relevant action.
    userId Number
    The ID of a GitLab user allowed to perform the relevant action.

    GetGroupProtectedBranchUnprotectAccessLevel

    AccessLevel string
    Access level allowed to perform the relevant action.
    AccessLevelDescription string
    Readable description of access level.
    GroupId int
    The ID of a GitLab group allowed to perform the relevant action.
    UserId int
    The ID of a GitLab user allowed to perform the relevant action.
    AccessLevel string
    Access level allowed to perform the relevant action.
    AccessLevelDescription string
    Readable description of access level.
    GroupId int
    The ID of a GitLab group allowed to perform the relevant action.
    UserId int
    The ID of a GitLab user allowed to perform the relevant action.
    access_level string
    Access level allowed to perform the relevant action.
    access_level_description string
    Readable description of access level.
    group_id number
    The ID of a GitLab group allowed to perform the relevant action.
    user_id number
    The ID of a GitLab user allowed to perform the relevant action.
    accessLevel String
    Access level allowed to perform the relevant action.
    accessLevelDescription String
    Readable description of access level.
    groupId Integer
    The ID of a GitLab group allowed to perform the relevant action.
    userId Integer
    The ID of a GitLab user allowed to perform the relevant action.
    accessLevel string
    Access level allowed to perform the relevant action.
    accessLevelDescription string
    Readable description of access level.
    groupId number
    The ID of a GitLab group allowed to perform the relevant action.
    userId number
    The ID of a GitLab user allowed to perform the relevant action.
    access_level str
    Access level allowed to perform the relevant action.
    access_level_description str
    Readable description of access level.
    group_id int
    The ID of a GitLab group allowed to perform the relevant action.
    user_id int
    The ID of a GitLab user allowed to perform the relevant action.
    accessLevel String
    Access level allowed to perform the relevant action.
    accessLevelDescription String
    Readable description of access level.
    groupId Number
    The ID of a GitLab group allowed to perform the relevant action.
    userId Number
    The ID of a GitLab user allowed to perform the relevant action.

    Package Details

    Repository
    GitLab pulumi/pulumi-gitlab
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the gitlab Terraform Provider.
    gitlab logo
    Viewing docs for GitLab v10.0.0
    published on Friday, Jun 26, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial