1. Packages
  2. Packages
  3. Gitlab Provider
  4. API Docs
  5. getProjectProtectedBranches
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.getProjectProtectedBranches data source allows details of the protected branches of a given project.

    Upstream API: GitLab REST API docs

    Using getProjectProtectedBranches

    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 getProjectProtectedBranches(args: GetProjectProtectedBranchesArgs, opts?: InvokeOptions): Promise<GetProjectProtectedBranchesResult>
    function getProjectProtectedBranchesOutput(args: GetProjectProtectedBranchesOutputArgs, opts?: InvokeOptions): Output<GetProjectProtectedBranchesResult>
    def get_project_protected_branches(project_id: Optional[str] = None,
                                       opts: Optional[InvokeOptions] = None) -> GetProjectProtectedBranchesResult
    def get_project_protected_branches_output(project_id: pulumi.Input[Optional[str]] = None,
                                       opts: Optional[InvokeOptions] = None) -> Output[GetProjectProtectedBranchesResult]
    func GetProjectProtectedBranches(ctx *Context, args *GetProjectProtectedBranchesArgs, opts ...InvokeOption) (*GetProjectProtectedBranchesResult, error)
    func GetProjectProtectedBranchesOutput(ctx *Context, args *GetProjectProtectedBranchesOutputArgs, opts ...InvokeOption) GetProjectProtectedBranchesResultOutput

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

    public static class GetProjectProtectedBranches 
    {
        public static Task<GetProjectProtectedBranchesResult> InvokeAsync(GetProjectProtectedBranchesArgs args, InvokeOptions? opts = null)
        public static Output<GetProjectProtectedBranchesResult> Invoke(GetProjectProtectedBranchesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetProjectProtectedBranchesResult> getProjectProtectedBranches(GetProjectProtectedBranchesArgs args, InvokeOptions options)
    public static Output<GetProjectProtectedBranchesResult> getProjectProtectedBranches(GetProjectProtectedBranchesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: gitlab:index/getProjectProtectedBranches:getProjectProtectedBranches
      arguments:
        # arguments dictionary
    data "gitlab_getprojectprotectedbranches" "name" {
        # arguments
    }

    The following arguments are supported:

    ProjectId string
    The integer or path with namespace that uniquely identifies the project.
    ProjectId string
    The integer or path with namespace that uniquely identifies the project.
    project_id string
    The integer or path with namespace that uniquely identifies the project.
    projectId String
    The integer or path with namespace that uniquely identifies the project.
    projectId string
    The integer or path with namespace that uniquely identifies the project.
    project_id str
    The integer or path with namespace that uniquely identifies the project.
    projectId String
    The integer or path with namespace that uniquely identifies the project.

    getProjectProtectedBranches Result

    The following output properties are available:

    Id int
    The ID of this resource.
    ProjectId string
    The integer or path with namespace that uniquely identifies the project.
    ProtectedBranches List<Pulumi.GitLab.Outputs.GetProjectProtectedBranchesProtectedBranch>
    A list of protected branches, as defined below.
    Id int
    The ID of this resource.
    ProjectId string
    The integer or path with namespace that uniquely identifies the project.
    ProtectedBranches []GetProjectProtectedBranchesProtectedBranch
    A list of protected branches, as defined below.
    id number
    The ID of this resource.
    project_id string
    The integer or path with namespace that uniquely identifies the project.
    protected_branches list(object)
    A list of protected branches, as defined below.
    id Integer
    The ID of this resource.
    projectId String
    The integer or path with namespace that uniquely identifies the project.
    protectedBranches List<GetProjectProtectedBranchesProtectedBranch>
    A list of protected branches, as defined below.
    id number
    The ID of this resource.
    projectId string
    The integer or path with namespace that uniquely identifies the project.
    protectedBranches GetProjectProtectedBranchesProtectedBranch[]
    A list of protected branches, as defined below.
    id int
    The ID of this resource.
    project_id str
    The integer or path with namespace that uniquely identifies the project.
    protected_branches Sequence[GetProjectProtectedBranchesProtectedBranch]
    A list of protected branches, as defined below.
    id Number
    The ID of this resource.
    projectId String
    The integer or path with namespace that uniquely identifies the project.
    protectedBranches List<Property Map>
    A list of protected branches, as defined below.

    Supporting Types

    GetProjectProtectedBranchesProtectedBranch

    AllowForcePush bool
    Whether force push is allowed.
    CodeOwnerApprovalRequired bool
    Reject code pushes that change files listed in the CODEOWNERS file.
    Id int
    The ID of this resource.
    MergeAccessLevels List<Pulumi.GitLab.Inputs.GetProjectProtectedBranchesProtectedBranchMergeAccessLevel>
    Array of merge access levels/users/groups allowed for the protected branch.
    Name string
    The name of the protected branch.
    PushAccessLevels List<Pulumi.GitLab.Inputs.GetProjectProtectedBranchesProtectedBranchPushAccessLevel>
    Array of push access levels/users/groups/deploy keys allowed for the protected branch.
    UnprotectAccessLevels List<Pulumi.GitLab.Inputs.GetProjectProtectedBranchesProtectedBranchUnprotectAccessLevel>
    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.
    Id int
    The ID of this resource.
    MergeAccessLevels []GetProjectProtectedBranchesProtectedBranchMergeAccessLevel
    Array of merge access levels/users/groups allowed for the protected branch.
    Name string
    The name of the protected branch.
    PushAccessLevels []GetProjectProtectedBranchesProtectedBranchPushAccessLevel
    Array of push access levels/users/groups/deploy keys allowed for the protected branch.
    UnprotectAccessLevels []GetProjectProtectedBranchesProtectedBranchUnprotectAccessLevel
    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.
    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.
    id Integer
    The ID of this resource.
    mergeAccessLevels List<GetProjectProtectedBranchesProtectedBranchMergeAccessLevel>
    Array of merge access levels/users/groups allowed for the protected branch.
    name String
    The name of the protected branch.
    pushAccessLevels List<GetProjectProtectedBranchesProtectedBranchPushAccessLevel>
    Array of push access levels/users/groups/deploy keys allowed for the protected branch.
    unprotectAccessLevels List<GetProjectProtectedBranchesProtectedBranchUnprotectAccessLevel>
    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.
    id number
    The ID of this resource.
    mergeAccessLevels GetProjectProtectedBranchesProtectedBranchMergeAccessLevel[]
    Array of merge access levels/users/groups allowed for the protected branch.
    name string
    The name of the protected branch.
    pushAccessLevels GetProjectProtectedBranchesProtectedBranchPushAccessLevel[]
    Array of push access levels/users/groups/deploy keys allowed for the protected branch.
    unprotectAccessLevels GetProjectProtectedBranchesProtectedBranchUnprotectAccessLevel[]
    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.
    id int
    The ID of this resource.
    merge_access_levels Sequence[GetProjectProtectedBranchesProtectedBranchMergeAccessLevel]
    Array of merge access levels/users/groups allowed for the protected branch.
    name str
    The name of the protected branch.
    push_access_levels Sequence[GetProjectProtectedBranchesProtectedBranchPushAccessLevel]
    Array of push access levels/users/groups/deploy keys allowed for the protected branch.
    unprotect_access_levels Sequence[GetProjectProtectedBranchesProtectedBranchUnprotectAccessLevel]
    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.
    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.

    GetProjectProtectedBranchesProtectedBranchMergeAccessLevel

    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.

    GetProjectProtectedBranchesProtectedBranchPushAccessLevel

    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.

    GetProjectProtectedBranchesProtectedBranchUnprotectAccessLevel

    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