Class BranchProtection
This resource allows you to protect a specific branch by an access level so that the user with less access level cannot Merge/Push to the branch. GitLab EE features to protect by group or user are not supported.
Example Usage
using Pulumi;
using GitLab = Pulumi.GitLab;
class MyStack : Stack
{
public MyStack()
{
var branchProtect = new GitLab.BranchProtection("branchProtect", new GitLab.BranchProtectionArgs
{
Branch = "BranchProtected",
MergeAccessLevel = "developer",
Project = "12345",
PushAccessLevel = "developer",
});
}
}
Inherited Members
Namespace: Pulumi.GitLab
Assembly: Pulumi.GitLab.dll
Syntax
public class BranchProtection : CustomResource
Constructors
View SourceBranchProtection(String, BranchProtectionArgs, CustomResourceOptions)
Create a BranchProtection resource with the given unique name, arguments, and options.
Declaration
public BranchProtection(string name, BranchProtectionArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| BranchProtectionArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceBranch
Name of the branch.
Declaration
public Output<string> Branch { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
MergeAccessLevel
One of five levels of access to the project.
Declaration
public Output<string> MergeAccessLevel { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Project
The id of the project.
Declaration
public Output<string> Project { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
PushAccessLevel
One of five levels of access to the project.
Declaration
public Output<string> PushAccessLevel { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, BranchProtectionState, CustomResourceOptions)
Get an existing BranchProtection resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static BranchProtection Get(string name, Input<string> id, BranchProtectionState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| BranchProtectionState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| BranchProtection |