Viewing docs for GitLab v9.10.0
published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
Viewing docs for GitLab v9.10.0
published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
The gitlab.getProjectProtectedBranch data source allows details of a protected branch to be retrieved by its name and the project it belongs to.
Upstream API: GitLab REST API docs
Using getProjectProtectedBranch
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 getProjectProtectedBranch(args: GetProjectProtectedBranchArgs, opts?: InvokeOptions): Promise<GetProjectProtectedBranchResult>
function getProjectProtectedBranchOutput(args: GetProjectProtectedBranchOutputArgs, opts?: InvokeOptions): Output<GetProjectProtectedBranchResult>def get_project_protected_branch(merge_access_levels: Optional[Sequence[GetProjectProtectedBranchMergeAccessLevel]] = None,
name: Optional[str] = None,
project_id: Optional[str] = None,
push_access_levels: Optional[Sequence[GetProjectProtectedBranchPushAccessLevel]] = None,
opts: Optional[InvokeOptions] = None) -> GetProjectProtectedBranchResult
def get_project_protected_branch_output(merge_access_levels: Optional[pulumi.Input[Sequence[pulumi.Input[GetProjectProtectedBranchMergeAccessLevelArgs]]]] = None,
name: Optional[pulumi.Input[str]] = None,
project_id: Optional[pulumi.Input[str]] = None,
push_access_levels: Optional[pulumi.Input[Sequence[pulumi.Input[GetProjectProtectedBranchPushAccessLevelArgs]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetProjectProtectedBranchResult]func GetProjectProtectedBranch(ctx *Context, args *GetProjectProtectedBranchArgs, opts ...InvokeOption) (*GetProjectProtectedBranchResult, error)
func GetProjectProtectedBranchOutput(ctx *Context, args *GetProjectProtectedBranchOutputArgs, opts ...InvokeOption) GetProjectProtectedBranchResultOutput> Note: This function is named GetProjectProtectedBranch in the Go SDK.
public static class GetProjectProtectedBranch
{
public static Task<GetProjectProtectedBranchResult> InvokeAsync(GetProjectProtectedBranchArgs args, InvokeOptions? opts = null)
public static Output<GetProjectProtectedBranchResult> Invoke(GetProjectProtectedBranchInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetProjectProtectedBranchResult> getProjectProtectedBranch(GetProjectProtectedBranchArgs args, InvokeOptions options)
public static Output<GetProjectProtectedBranchResult> getProjectProtectedBranch(GetProjectProtectedBranchArgs args, InvokeOptions options)
fn::invoke:
function: gitlab:index/getProjectProtectedBranch:getProjectProtectedBranch
arguments:
# arguments dictionaryThe following arguments are supported:
- Name string
- The name of the protected branch.
- Project
Id string - The integer or path with namespace that uniquely identifies the project.
- Merge
Access List<Pulumi.Levels Git Lab. Inputs. Get Project Protected Branch Merge Access Level> - Array of access levels and user(s)/group(s) allowed to merge to protected branch.
- Push
Access List<Pulumi.Levels Git Lab. Inputs. Get Project Protected Branch Push Access Level> - Array of access levels and user(s)/group(s) allowed to push to protected branch.
- Name string
- The name of the protected branch.
- Project
Id string - The integer or path with namespace that uniquely identifies the project.
- Merge
Access []GetLevels Project Protected Branch Merge Access Level - Array of access levels and user(s)/group(s) allowed to merge to protected branch.
- Push
Access []GetLevels Project Protected Branch Push Access Level - Array of access levels and user(s)/group(s) allowed to push to protected branch.
- name String
- The name of the protected branch.
- project
Id String - The integer or path with namespace that uniquely identifies the project.
- merge
Access List<GetLevels Project Protected Branch Merge Access Level> - Array of access levels and user(s)/group(s) allowed to merge to protected branch.
- push
Access List<GetLevels Project Protected Branch Push Access Level> - Array of access levels and user(s)/group(s) allowed to push to protected branch.
- name string
- The name of the protected branch.
- project
Id string - The integer or path with namespace that uniquely identifies the project.
- merge
Access GetLevels Project Protected Branch Merge Access Level[] - Array of access levels and user(s)/group(s) allowed to merge to protected branch.
- push
Access GetLevels Project Protected Branch Push Access Level[] - Array of access levels and user(s)/group(s) allowed to push to protected branch.
- name str
- The name of the protected branch.
- project_
id str - The integer or path with namespace that uniquely identifies the project.
- merge_
access_ Sequence[Getlevels Project Protected Branch Merge Access Level] - Array of access levels and user(s)/group(s) allowed to merge to protected branch.
- push_
access_ Sequence[Getlevels Project Protected Branch Push Access Level] - Array of access levels and user(s)/group(s) allowed to push to protected branch.
- name String
- The name of the protected branch.
- project
Id String - The integer or path with namespace that uniquely identifies the project.
- merge
Access List<Property Map>Levels - Array of access levels and user(s)/group(s) allowed to merge to protected branch.
- push
Access List<Property Map>Levels - Array of access levels and user(s)/group(s) allowed to push to protected branch.
getProjectProtectedBranch Result
The following output properties are available:
- Allow
Force boolPush - Whether force push is allowed.
- Code
Owner boolApproval Required - Reject code pushes that change files listed in the CODEOWNERS file.
- Id int
- The ID of this resource.
- Name string
- The name of the protected branch.
- Project
Id string - The integer or path with namespace that uniquely identifies the project.
- Merge
Access List<Pulumi.Levels Git Lab. Outputs. Get Project Protected Branch Merge Access Level> - Array of access levels and user(s)/group(s) allowed to merge to protected branch.
- Push
Access List<Pulumi.Levels Git Lab. Outputs. Get Project Protected Branch Push Access Level> - Array of access levels and user(s)/group(s) allowed to push to protected branch.
- Allow
Force boolPush - Whether force push is allowed.
- Code
Owner boolApproval Required - Reject code pushes that change files listed in the CODEOWNERS file.
- Id int
- The ID of this resource.
- Name string
- The name of the protected branch.
- Project
Id string - The integer or path with namespace that uniquely identifies the project.
- Merge
Access []GetLevels Project Protected Branch Merge Access Level - Array of access levels and user(s)/group(s) allowed to merge to protected branch.
- Push
Access []GetLevels Project Protected Branch Push Access Level - Array of access levels and user(s)/group(s) allowed to push to protected branch.
- allow
Force BooleanPush - Whether force push is allowed.
- code
Owner BooleanApproval Required - Reject code pushes that change files listed in the CODEOWNERS file.
- id Integer
- The ID of this resource.
- name String
- The name of the protected branch.
- project
Id String - The integer or path with namespace that uniquely identifies the project.
- merge
Access List<GetLevels Project Protected Branch Merge Access Level> - Array of access levels and user(s)/group(s) allowed to merge to protected branch.
- push
Access List<GetLevels Project Protected Branch Push Access Level> - Array of access levels and user(s)/group(s) allowed to push to protected branch.
- allow
Force booleanPush - Whether force push is allowed.
- code
Owner booleanApproval Required - Reject code pushes that change files listed in the CODEOWNERS file.
- id number
- The ID of this resource.
- name string
- The name of the protected branch.
- project
Id string - The integer or path with namespace that uniquely identifies the project.
- merge
Access GetLevels Project Protected Branch Merge Access Level[] - Array of access levels and user(s)/group(s) allowed to merge to protected branch.
- push
Access GetLevels Project Protected Branch Push Access Level[] - Array of access levels and user(s)/group(s) allowed to push to protected branch.
- allow_
force_ boolpush - Whether force push is allowed.
- code_
owner_ boolapproval_ required - Reject code pushes that change files listed in the CODEOWNERS file.
- id int
- The ID of this resource.
- name str
- The name of the protected branch.
- project_
id str - The integer or path with namespace that uniquely identifies the project.
- merge_
access_ Sequence[Getlevels Project Protected Branch Merge Access Level] - Array of access levels and user(s)/group(s) allowed to merge to protected branch.
- push_
access_ Sequence[Getlevels Project Protected Branch Push Access Level] - Array of access levels and user(s)/group(s) allowed to push to protected branch.
- allow
Force BooleanPush - Whether force push is allowed.
- code
Owner BooleanApproval Required - Reject code pushes that change files listed in the CODEOWNERS file.
- id Number
- The ID of this resource.
- name String
- The name of the protected branch.
- project
Id String - The integer or path with namespace that uniquely identifies the project.
- merge
Access List<Property Map>Levels - Array of access levels and user(s)/group(s) allowed to merge to protected branch.
- push
Access List<Property Map>Levels - Array of access levels and user(s)/group(s) allowed to push to protected branch.
Supporting Types
GetProjectProtectedBranchMergeAccessLevel
- Access
Level string - Access levels allowed to merge to protected branch. 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
user_id. - User
Id int - The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with
group_id.
- Access
Level string - Access levels allowed to merge to protected branch. 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
user_id. - User
Id int - The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with
group_id.
- access
Level String - Access levels allowed to merge to protected branch. 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
user_id. - user
Id Integer - The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with
group_id.
- access
Level string - Access levels allowed to merge to protected branch. 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
user_id. - user
Id number - The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with
group_id.
- access_
level str - Access levels allowed to merge to protected branch. 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
user_id. - user_
id int - The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with
group_id.
- access
Level String - Access levels allowed to merge to protected branch. 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
user_id. - user
Id Number - The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with
group_id.
GetProjectProtectedBranchPushAccessLevel
- Access
Level string - Access levels allowed to push to protected branch. 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
group_idanduser_id. This field is read-only until Gitlab 17.5. - Group
Id int - The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with
deploy_key_idanduser_id. - User
Id int - The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with
deploy_key_idandgroup_id.
- Access
Level string - Access levels allowed to push to protected branch. 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
group_idanduser_id. This field is read-only until Gitlab 17.5. - Group
Id int - The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with
deploy_key_idanduser_id. - User
Id int - The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with
deploy_key_idandgroup_id.
- access
Level String - Access levels allowed to push to protected branch. 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
group_idanduser_id. This field is read-only until Gitlab 17.5. - group
Id Integer - The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with
deploy_key_idanduser_id. - user
Id Integer - The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with
deploy_key_idandgroup_id.
- access
Level string - Access levels allowed to push to protected branch. 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
group_idanduser_id. This field is read-only until Gitlab 17.5. - group
Id number - The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with
deploy_key_idanduser_id. - user
Id number - The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with
deploy_key_idandgroup_id.
- access_
level str - Access levels allowed to push to protected branch. 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
group_idanduser_id. This field is read-only until Gitlab 17.5. - group_
id int - The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with
deploy_key_idanduser_id. - user_
id int - The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with
deploy_key_idandgroup_id.
- access
Level String - Access levels allowed to push to protected branch. 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
group_idanduser_id. This field is read-only until Gitlab 17.5. - group
Id Number - The ID of a GitLab group allowed to perform the relevant action. Mutually exclusive with
deploy_key_idanduser_id. - user
Id Number - The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with
deploy_key_idandgroup_id.
Package Details
- Repository
- GitLab pulumi/pulumi-gitlab
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
gitlabTerraform Provider.
Viewing docs for GitLab v9.10.0
published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
