gitlab.BranchProtection
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
const branchProtect = new gitlab.BranchProtection("BranchProtect", {
project: "12345",
branch: "BranchProtected",
pushAccessLevel: "developer",
mergeAccessLevel: "developer",
unprotectAccessLevel: "developer",
allowForcePush: true,
codeOwnerApprovalRequired: true,
allowedToPushes: [
{
userId: 5,
},
{
userId: 521,
},
],
allowedToMerges: [
{
userId: 15,
},
{
userId: 37,
},
],
allowedToUnprotects: [
{
userId: 15,
},
{
groupId: 42,
},
],
});
// Example using dynamic block
const main = new gitlab.BranchProtection("main", {
allowedToPushes: [
50,
55,
60,
].map((v, k) => ({key: k, value: v})).map(entry => ({
userId: entry.value,
})),
project: "12345",
branch: "main",
pushAccessLevel: "maintainer",
mergeAccessLevel: "maintainer",
unprotectAccessLevel: "maintainer",
});
import pulumi
import pulumi_gitlab as gitlab
branch_protect = gitlab.BranchProtection("BranchProtect",
project="12345",
branch="BranchProtected",
push_access_level="developer",
merge_access_level="developer",
unprotect_access_level="developer",
allow_force_push=True,
code_owner_approval_required=True,
allowed_to_pushes=[
{
"user_id": 5,
},
{
"user_id": 521,
},
],
allowed_to_merges=[
{
"user_id": 15,
},
{
"user_id": 37,
},
],
allowed_to_unprotects=[
{
"user_id": 15,
},
{
"group_id": 42,
},
])
# Example using dynamic block
main = gitlab.BranchProtection("main",
allowed_to_pushes=[{
"user_id": entry["value"],
} for entry in [{"key": k, "value": v} for k, v in [
50,
55,
60,
]]],
project="12345",
branch="main",
push_access_level="maintainer",
merge_access_level="maintainer",
unprotect_access_level="maintainer")
Coming soon!
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;
return await Deployment.RunAsync(() =>
{
var branchProtect = new GitLab.BranchProtection("BranchProtect", new()
{
Project = "12345",
Branch = "BranchProtected",
PushAccessLevel = "developer",
MergeAccessLevel = "developer",
UnprotectAccessLevel = "developer",
AllowForcePush = true,
CodeOwnerApprovalRequired = true,
AllowedToPushes = new[]
{
new GitLab.Inputs.BranchProtectionAllowedToPushArgs
{
UserId = 5,
},
new GitLab.Inputs.BranchProtectionAllowedToPushArgs
{
UserId = 521,
},
},
AllowedToMerges = new[]
{
new GitLab.Inputs.BranchProtectionAllowedToMergeArgs
{
UserId = 15,
},
new GitLab.Inputs.BranchProtectionAllowedToMergeArgs
{
UserId = 37,
},
},
AllowedToUnprotects = new[]
{
new GitLab.Inputs.BranchProtectionAllowedToUnprotectArgs
{
UserId = 15,
},
new GitLab.Inputs.BranchProtectionAllowedToUnprotectArgs
{
GroupId = 42,
},
},
});
// Example using dynamic block
var main = new GitLab.BranchProtection("main", new()
{
AllowedToPushes = new[]
{
50,
55,
60,
}.Select((v, k) => new { Key = k, Value = v }).Select(entry =>
{
return new GitLab.Inputs.BranchProtectionAllowedToPushArgs
{
UserId = entry.Value,
};
}).ToList(),
Project = "12345",
Branch = "main",
PushAccessLevel = "maintainer",
MergeAccessLevel = "maintainer",
UnprotectAccessLevel = "maintainer",
});
});
Coming soon!
Coming soon!
Create BranchProtection Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new BranchProtection(name: string, args: BranchProtectionArgs, opts?: CustomResourceOptions);
@overload
def BranchProtection(resource_name: str,
args: BranchProtectionArgs,
opts: Optional[ResourceOptions] = None)
@overload
def BranchProtection(resource_name: str,
opts: Optional[ResourceOptions] = None,
branch: Optional[str] = None,
project: Optional[str] = None,
allow_force_push: Optional[bool] = None,
allowed_to_merges: Optional[Sequence[BranchProtectionAllowedToMergeArgs]] = None,
allowed_to_pushes: Optional[Sequence[BranchProtectionAllowedToPushArgs]] = None,
allowed_to_unprotects: Optional[Sequence[BranchProtectionAllowedToUnprotectArgs]] = None,
code_owner_approval_required: Optional[bool] = None,
merge_access_level: Optional[str] = None,
push_access_level: Optional[str] = None,
unprotect_access_level: Optional[str] = None)
func NewBranchProtection(ctx *Context, name string, args BranchProtectionArgs, opts ...ResourceOption) (*BranchProtection, error)
public BranchProtection(string name, BranchProtectionArgs args, CustomResourceOptions? opts = null)
public BranchProtection(String name, BranchProtectionArgs args)
public BranchProtection(String name, BranchProtectionArgs args, CustomResourceOptions options)
type: gitlab:BranchProtection
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args BranchProtectionArgs
- 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 BranchProtectionArgs
- 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 BranchProtectionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args BranchProtectionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args BranchProtectionArgs
- 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 branchProtectionResource = new GitLab.BranchProtection("branchProtectionResource", new()
{
Branch = "string",
Project = "string",
AllowForcePush = false,
AllowedToMerges = new[]
{
new GitLab.Inputs.BranchProtectionAllowedToMergeArgs
{
AccessLevel = "string",
AccessLevelDescription = "string",
GroupId = 0,
UserId = 0,
},
},
AllowedToPushes = new[]
{
new GitLab.Inputs.BranchProtectionAllowedToPushArgs
{
AccessLevel = "string",
AccessLevelDescription = "string",
GroupId = 0,
UserId = 0,
},
},
AllowedToUnprotects = new[]
{
new GitLab.Inputs.BranchProtectionAllowedToUnprotectArgs
{
AccessLevel = "string",
AccessLevelDescription = "string",
GroupId = 0,
UserId = 0,
},
},
CodeOwnerApprovalRequired = false,
MergeAccessLevel = "string",
PushAccessLevel = "string",
UnprotectAccessLevel = "string",
});
example, err := gitlab.NewBranchProtection(ctx, "branchProtectionResource", &gitlab.BranchProtectionArgs{
Branch: pulumi.String("string"),
Project: pulumi.String("string"),
AllowForcePush: pulumi.Bool(false),
AllowedToMerges: gitlab.BranchProtectionAllowedToMergeArray{
&gitlab.BranchProtectionAllowedToMergeArgs{
AccessLevel: pulumi.String("string"),
AccessLevelDescription: pulumi.String("string"),
GroupId: pulumi.Int(0),
UserId: pulumi.Int(0),
},
},
AllowedToPushes: gitlab.BranchProtectionAllowedToPushArray{
&gitlab.BranchProtectionAllowedToPushArgs{
AccessLevel: pulumi.String("string"),
AccessLevelDescription: pulumi.String("string"),
GroupId: pulumi.Int(0),
UserId: pulumi.Int(0),
},
},
AllowedToUnprotects: gitlab.BranchProtectionAllowedToUnprotectArray{
&gitlab.BranchProtectionAllowedToUnprotectArgs{
AccessLevel: pulumi.String("string"),
AccessLevelDescription: pulumi.String("string"),
GroupId: pulumi.Int(0),
UserId: pulumi.Int(0),
},
},
CodeOwnerApprovalRequired: pulumi.Bool(false),
MergeAccessLevel: pulumi.String("string"),
PushAccessLevel: pulumi.String("string"),
UnprotectAccessLevel: pulumi.String("string"),
})
var branchProtectionResource = new BranchProtection("branchProtectionResource", BranchProtectionArgs.builder()
.branch("string")
.project("string")
.allowForcePush(false)
.allowedToMerges(BranchProtectionAllowedToMergeArgs.builder()
.accessLevel("string")
.accessLevelDescription("string")
.groupId(0)
.userId(0)
.build())
.allowedToPushes(BranchProtectionAllowedToPushArgs.builder()
.accessLevel("string")
.accessLevelDescription("string")
.groupId(0)
.userId(0)
.build())
.allowedToUnprotects(BranchProtectionAllowedToUnprotectArgs.builder()
.accessLevel("string")
.accessLevelDescription("string")
.groupId(0)
.userId(0)
.build())
.codeOwnerApprovalRequired(false)
.mergeAccessLevel("string")
.pushAccessLevel("string")
.unprotectAccessLevel("string")
.build());
branch_protection_resource = gitlab.BranchProtection("branchProtectionResource",
branch="string",
project="string",
allow_force_push=False,
allowed_to_merges=[gitlab.BranchProtectionAllowedToMergeArgs(
access_level="string",
access_level_description="string",
group_id=0,
user_id=0,
)],
allowed_to_pushes=[gitlab.BranchProtectionAllowedToPushArgs(
access_level="string",
access_level_description="string",
group_id=0,
user_id=0,
)],
allowed_to_unprotects=[gitlab.BranchProtectionAllowedToUnprotectArgs(
access_level="string",
access_level_description="string",
group_id=0,
user_id=0,
)],
code_owner_approval_required=False,
merge_access_level="string",
push_access_level="string",
unprotect_access_level="string")
const branchProtectionResource = new gitlab.BranchProtection("branchProtectionResource", {
branch: "string",
project: "string",
allowForcePush: false,
allowedToMerges: [{
accessLevel: "string",
accessLevelDescription: "string",
groupId: 0,
userId: 0,
}],
allowedToPushes: [{
accessLevel: "string",
accessLevelDescription: "string",
groupId: 0,
userId: 0,
}],
allowedToUnprotects: [{
accessLevel: "string",
accessLevelDescription: "string",
groupId: 0,
userId: 0,
}],
codeOwnerApprovalRequired: false,
mergeAccessLevel: "string",
pushAccessLevel: "string",
unprotectAccessLevel: "string",
});
type: gitlab:BranchProtection
properties:
allowForcePush: false
allowedToMerges:
- accessLevel: string
accessLevelDescription: string
groupId: 0
userId: 0
allowedToPushes:
- accessLevel: string
accessLevelDescription: string
groupId: 0
userId: 0
allowedToUnprotects:
- accessLevel: string
accessLevelDescription: string
groupId: 0
userId: 0
branch: string
codeOwnerApprovalRequired: false
mergeAccessLevel: string
project: string
pushAccessLevel: string
unprotectAccessLevel: string
BranchProtection Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The BranchProtection resource accepts the following input properties:
- Branch string
- Name of the branch.
- Project string
- The id of the project.
- 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. Branch Protection Allowed To Merge> - Array of access levels and user(s)/group(s) allowed to merge to protected branch.
- Allowed
To List<Pulumi.Pushes Git Lab. Inputs. Branch Protection Allowed To Push> - Array of access levels and user(s)/group(s) allowed to push to protected branch.
- Allowed
To List<Pulumi.Unprotects Git Lab. Inputs. Branch Protection Allowed To Unprotect> - Array of access levels and user(s)/group(s) allowed to unprotect push to protected branch.
- Code
Owner boolApproval Required - Can be set to true to require code owner approval before merging. Only available for Premium and Ultimate instances.
- Merge
Access stringLevel - Access levels allowed to merge. Valid values are:
no one
,developer
,maintainer
. - Push
Access stringLevel - Access levels allowed to push. Valid values are:
no one
,developer
,maintainer
. - Unprotect
Access stringLevel - Access levels allowed to unprotect. Valid values are:
developer
,maintainer
,admin
.
- Branch string
- Name of the branch.
- Project string
- The id of the project.
- Allow
Force boolPush - Can be set to true to allow users with push access to force push.
- Allowed
To []BranchMerges Protection Allowed To Merge Args - Array of access levels and user(s)/group(s) allowed to merge to protected branch.
- Allowed
To []BranchPushes Protection Allowed To Push Args - Array of access levels and user(s)/group(s) allowed to push to protected branch.
- Allowed
To []BranchUnprotects Protection Allowed To Unprotect Args - Array of access levels and user(s)/group(s) allowed to unprotect push to protected branch.
- Code
Owner boolApproval Required - Can be set to true to require code owner approval before merging. Only available for Premium and Ultimate instances.
- Merge
Access stringLevel - Access levels allowed to merge. Valid values are:
no one
,developer
,maintainer
. - Push
Access stringLevel - Access levels allowed to push. Valid values are:
no one
,developer
,maintainer
. - Unprotect
Access stringLevel - Access levels allowed to unprotect. Valid values are:
developer
,maintainer
,admin
.
- branch String
- Name of the branch.
- project String
- The id of the project.
- allow
Force BooleanPush - Can be set to true to allow users with push access to force push.
- allowed
To List<BranchMerges Protection Allowed To Merge> - Array of access levels and user(s)/group(s) allowed to merge to protected branch.
- allowed
To List<BranchPushes Protection Allowed To Push> - Array of access levels and user(s)/group(s) allowed to push to protected branch.
- allowed
To List<BranchUnprotects Protection Allowed To Unprotect> - Array of access levels and user(s)/group(s) allowed to unprotect push to protected branch.
- code
Owner BooleanApproval Required - Can be set to true to require code owner approval before merging. Only available for Premium and Ultimate instances.
- merge
Access StringLevel - Access levels allowed to merge. Valid values are:
no one
,developer
,maintainer
. - push
Access StringLevel - Access levels allowed to push. Valid values are:
no one
,developer
,maintainer
. - unprotect
Access StringLevel - Access levels allowed to unprotect. Valid values are:
developer
,maintainer
,admin
.
- branch string
- Name of the branch.
- project string
- The id of the project.
- allow
Force booleanPush - Can be set to true to allow users with push access to force push.
- allowed
To BranchMerges Protection Allowed To Merge[] - Array of access levels and user(s)/group(s) allowed to merge to protected branch.
- allowed
To BranchPushes Protection Allowed To Push[] - Array of access levels and user(s)/group(s) allowed to push to protected branch.
- allowed
To BranchUnprotects Protection Allowed To Unprotect[] - Array of access levels and user(s)/group(s) allowed to unprotect push to protected branch.
- code
Owner booleanApproval Required - Can be set to true to require code owner approval before merging. Only available for Premium and Ultimate instances.
- merge
Access stringLevel - Access levels allowed to merge. Valid values are:
no one
,developer
,maintainer
. - push
Access stringLevel - Access levels allowed to push. Valid values are:
no one
,developer
,maintainer
. - unprotect
Access stringLevel - Access levels allowed to unprotect. Valid values are:
developer
,maintainer
,admin
.
- branch str
- Name of the branch.
- project str
- The id of the project.
- allow_
force_ boolpush - Can be set to true to allow users with push access to force push.
- allowed_
to_ Sequence[Branchmerges Protection Allowed To Merge Args] - Array of access levels and user(s)/group(s) allowed to merge to protected branch.
- allowed_
to_ Sequence[Branchpushes Protection Allowed To Push Args] - Array of access levels and user(s)/group(s) allowed to push to protected branch.
- allowed_
to_ Sequence[Branchunprotects Protection Allowed To Unprotect Args] - Array of access levels and user(s)/group(s) allowed to unprotect push to protected branch.
- code_
owner_ boolapproval_ required - Can be set to true to require code owner approval before merging. Only available for Premium and Ultimate instances.
- merge_
access_ strlevel - Access levels allowed to merge. Valid values are:
no one
,developer
,maintainer
. - push_
access_ strlevel - Access levels allowed to push. Valid values are:
no one
,developer
,maintainer
. - unprotect_
access_ strlevel - Access levels allowed to unprotect. Valid values are:
developer
,maintainer
,admin
.
- branch String
- Name of the branch.
- project String
- The id of the project.
- 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 access levels and user(s)/group(s) allowed to merge to protected branch.
- allowed
To List<Property Map>Pushes - Array of access levels and user(s)/group(s) allowed to push to protected branch.
- allowed
To List<Property Map>Unprotects - Array of access levels and user(s)/group(s) allowed to unprotect push to protected branch.
- code
Owner BooleanApproval Required - Can be set to true to require code owner approval before merging. Only available for Premium and Ultimate instances.
- merge
Access StringLevel - Access levels allowed to merge. Valid values are:
no one
,developer
,maintainer
. - push
Access StringLevel - Access levels allowed to push. Valid values are:
no one
,developer
,maintainer
. - unprotect
Access StringLevel - Access levels allowed to unprotect. Valid values are:
developer
,maintainer
,admin
.
Outputs
All input properties are implicitly available as output properties. Additionally, the BranchProtection 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 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 BranchProtection Resource
Get an existing BranchProtection 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?: BranchProtectionState, opts?: CustomResourceOptions): BranchProtection
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
allow_force_push: Optional[bool] = None,
allowed_to_merges: Optional[Sequence[BranchProtectionAllowedToMergeArgs]] = None,
allowed_to_pushes: Optional[Sequence[BranchProtectionAllowedToPushArgs]] = None,
allowed_to_unprotects: Optional[Sequence[BranchProtectionAllowedToUnprotectArgs]] = None,
branch: Optional[str] = None,
branch_protection_id: Optional[int] = None,
code_owner_approval_required: Optional[bool] = None,
merge_access_level: Optional[str] = None,
project: Optional[str] = None,
push_access_level: Optional[str] = None,
unprotect_access_level: Optional[str] = None) -> BranchProtection
func GetBranchProtection(ctx *Context, name string, id IDInput, state *BranchProtectionState, opts ...ResourceOption) (*BranchProtection, error)
public static BranchProtection Get(string name, Input<string> id, BranchProtectionState? state, CustomResourceOptions? opts = null)
public static BranchProtection get(String name, Output<String> id, BranchProtectionState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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. Branch Protection Allowed To Merge> - Array of access levels and user(s)/group(s) allowed to merge to protected branch.
- Allowed
To List<Pulumi.Pushes Git Lab. Inputs. Branch Protection Allowed To Push> - Array of access levels and user(s)/group(s) allowed to push to protected branch.
- Allowed
To List<Pulumi.Unprotects Git Lab. Inputs. Branch Protection Allowed To Unprotect> - Array of access levels and user(s)/group(s) allowed to unprotect push to protected branch.
- Branch string
- Name of the branch.
- 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. Only available for Premium and Ultimate instances.
- Merge
Access stringLevel - Access levels allowed to merge. Valid values are:
no one
,developer
,maintainer
. - Project string
- The id of the project.
- Push
Access stringLevel - Access levels allowed to push. Valid values are:
no one
,developer
,maintainer
. - Unprotect
Access stringLevel - Access levels allowed to unprotect. Valid values are:
developer
,maintainer
,admin
.
- Allow
Force boolPush - Can be set to true to allow users with push access to force push.
- Allowed
To []BranchMerges Protection Allowed To Merge Args - Array of access levels and user(s)/group(s) allowed to merge to protected branch.
- Allowed
To []BranchPushes Protection Allowed To Push Args - Array of access levels and user(s)/group(s) allowed to push to protected branch.
- Allowed
To []BranchUnprotects Protection Allowed To Unprotect Args - Array of access levels and user(s)/group(s) allowed to unprotect push to protected branch.
- Branch string
- Name of the branch.
- 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. Only available for Premium and Ultimate instances.
- Merge
Access stringLevel - Access levels allowed to merge. Valid values are:
no one
,developer
,maintainer
. - Project string
- The id of the project.
- Push
Access stringLevel - Access levels allowed to push. Valid values are:
no one
,developer
,maintainer
. - Unprotect
Access stringLevel - Access levels allowed to unprotect. Valid values are:
developer
,maintainer
,admin
.
- allow
Force BooleanPush - Can be set to true to allow users with push access to force push.
- allowed
To List<BranchMerges Protection Allowed To Merge> - Array of access levels and user(s)/group(s) allowed to merge to protected branch.
- allowed
To List<BranchPushes Protection Allowed To Push> - Array of access levels and user(s)/group(s) allowed to push to protected branch.
- allowed
To List<BranchUnprotects Protection Allowed To Unprotect> - Array of access levels and user(s)/group(s) allowed to unprotect push to protected branch.
- branch String
- Name of the branch.
- 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. Only available for Premium and Ultimate instances.
- merge
Access StringLevel - Access levels allowed to merge. Valid values are:
no one
,developer
,maintainer
. - project String
- The id of the project.
- push
Access StringLevel - Access levels allowed to push. Valid values are:
no one
,developer
,maintainer
. - unprotect
Access StringLevel - Access levels allowed to unprotect. Valid values are:
developer
,maintainer
,admin
.
- allow
Force booleanPush - Can be set to true to allow users with push access to force push.
- allowed
To BranchMerges Protection Allowed To Merge[] - Array of access levels and user(s)/group(s) allowed to merge to protected branch.
- allowed
To BranchPushes Protection Allowed To Push[] - Array of access levels and user(s)/group(s) allowed to push to protected branch.
- allowed
To BranchUnprotects Protection Allowed To Unprotect[] - Array of access levels and user(s)/group(s) allowed to unprotect push to protected branch.
- branch string
- Name of the branch.
- 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. Only available for Premium and Ultimate instances.
- merge
Access stringLevel - Access levels allowed to merge. Valid values are:
no one
,developer
,maintainer
. - project string
- The id of the project.
- push
Access stringLevel - Access levels allowed to push. Valid values are:
no one
,developer
,maintainer
. - unprotect
Access stringLevel - Access levels allowed to unprotect. Valid values are:
developer
,maintainer
,admin
.
- allow_
force_ boolpush - Can be set to true to allow users with push access to force push.
- allowed_
to_ Sequence[Branchmerges Protection Allowed To Merge Args] - Array of access levels and user(s)/group(s) allowed to merge to protected branch.
- allowed_
to_ Sequence[Branchpushes Protection Allowed To Push Args] - Array of access levels and user(s)/group(s) allowed to push to protected branch.
- allowed_
to_ Sequence[Branchunprotects Protection Allowed To Unprotect Args] - Array of access levels and user(s)/group(s) allowed to unprotect push to protected branch.
- branch str
- Name of the branch.
- 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. Only available for Premium and Ultimate instances.
- merge_
access_ strlevel - Access levels allowed to merge. Valid values are:
no one
,developer
,maintainer
. - project str
- The id of the project.
- push_
access_ strlevel - Access levels allowed to push. Valid values are:
no one
,developer
,maintainer
. - unprotect_
access_ strlevel - Access levels allowed to unprotect. Valid values are:
developer
,maintainer
,admin
.
- 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 access levels and user(s)/group(s) allowed to merge to protected branch.
- allowed
To List<Property Map>Pushes - Array of access levels and user(s)/group(s) allowed to push to protected branch.
- allowed
To List<Property Map>Unprotects - Array of access levels and user(s)/group(s) allowed to unprotect push to protected branch.
- branch String
- Name of the branch.
- 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. Only available for Premium and Ultimate instances.
- merge
Access StringLevel - Access levels allowed to merge. Valid values are:
no one
,developer
,maintainer
. - project String
- The id of the project.
- push
Access StringLevel - Access levels allowed to push. Valid values are:
no one
,developer
,maintainer
. - unprotect
Access StringLevel - Access levels allowed to unprotect. Valid values are:
developer
,maintainer
,admin
.
Supporting Types
BranchProtectionAllowedToMerge, BranchProtectionAllowedToMergeArgs
- Access
Level string - Access levels allowed to merge to protected branch. Valid values are:
no one
,developer
,maintainer
. - 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
. - 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
. - 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
. - 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
. - 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
. - 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
.
BranchProtectionAllowedToPush, BranchProtectionAllowedToPushArgs
- Access
Level string - Access levels allowed to push to protected branch. Valid values are:
no one
,developer
,maintainer
. - 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 push to protected branch. Valid values are:
no one
,developer
,maintainer
. - 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 push to protected branch. Valid values are:
no one
,developer
,maintainer
. - 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 push to protected branch. Valid values are:
no one
,developer
,maintainer
. - 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 push to protected branch. Valid values are:
no one
,developer
,maintainer
. - 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 push to protected branch. Valid values are:
no one
,developer
,maintainer
. - 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
.
BranchProtectionAllowedToUnprotect, BranchProtectionAllowedToUnprotectArgs
- Access
Level string - Access levels allowed to unprotect push to protected branch. 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
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 unprotect push to protected branch. 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
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 unprotect push to protected branch. 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
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 unprotect push to protected branch. 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
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 unprotect push to protected branch. 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
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 unprotect push to protected branch. 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
user_id
. - user
Id Number - The ID of a GitLab user allowed to perform the relevant action. Mutually exclusive with
group_id
.
Import
Gitlab protected branches can be imported with a key composed of <project_id>:<branch>
, e.g.
$ pulumi import gitlab:index/branchProtection:BranchProtection BranchProtect "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
gitlab
Terraform Provider.