Show / Hide Table of Contents

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",
    });
}

}
Inheritance
System.Object
Resource
CustomResource
BranchProtection
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.GitLab
Assembly: Pulumi.GitLab.dll
Syntax
public class BranchProtection : CustomResource

Constructors

View Source

BranchProtection(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 Source

Branch

Name of the branch.

Declaration
public Output<string> Branch { get; }
Property Value
Type Description
Output<System.String>
View Source

MergeAccessLevel

One of five levels of access to the project.

Declaration
public Output<string> MergeAccessLevel { get; }
Property Value
Type Description
Output<System.String>
View Source

Project

The id of the project.

Declaration
public Output<string> Project { get; }
Property Value
Type Description
Output<System.String>
View Source

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 Source

Get(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
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.