ProjectApprovalRule

# gitlab_project_approval_rule

This resource allows you to create and manage multiple approval rules for your GitLab projects. For further information on approval rules, consult the gitlab documentation.

This feature requires a GitLab Starter account or above.

Example Usage

using Pulumi;
using GitLab = Pulumi.GitLab;

class MyStack : Stack
{
    public MyStack()
    {
        var example_one = new GitLab.ProjectApprovalRule("example-one", new GitLab.ProjectApprovalRuleArgs
        {
            ApprovalsRequired = 3,
            GroupIds = 
            {
                51,
            },
            Project = "5",
            UserIds = 
            {
                50,
                500,
            },
        });
        var example_two = new GitLab.ProjectApprovalRule("example-two", new GitLab.ProjectApprovalRuleArgs
        {
            ApprovalsRequired = 1,
            GroupIds = 
            {
                52,
            },
            Project = "5",
            UserIds = {},
        });
    }

}

Coming soon!

import pulumi
import pulumi_gitlab as gitlab

example_one = gitlab.ProjectApprovalRule("example-one",
    approvals_required=3,
    group_ids=[51],
    project="5",
    user_ids=[
        50,
        500,
    ])
example_two = gitlab.ProjectApprovalRule("example-two",
    approvals_required=1,
    group_ids=[52],
    project="5",
    user_ids=[])
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";

const example_one = new gitlab.ProjectApprovalRule("example-one", {
    approvalsRequired: 3,
    groupIds: [51],
    project: "5",
    userIds: [
        50,
        500,
    ],
});
const example_two = new gitlab.ProjectApprovalRule("example-two", {
    approvalsRequired: 1,
    groupIds: [52],
    project: "5",
    userIds: [],
});

Create a ProjectApprovalRule Resource

new ProjectApprovalRule(name: string, args: ProjectApprovalRuleArgs, opts?: CustomResourceOptions);
@overload
def ProjectApprovalRule(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        approvals_required: Optional[int] = None,
                        group_ids: Optional[Sequence[int]] = None,
                        name: Optional[str] = None,
                        project: Optional[str] = None,
                        user_ids: Optional[Sequence[int]] = None)
@overload
def ProjectApprovalRule(resource_name: str,
                        args: ProjectApprovalRuleArgs,
                        opts: Optional[ResourceOptions] = None)
func NewProjectApprovalRule(ctx *Context, name string, args ProjectApprovalRuleArgs, opts ...ResourceOption) (*ProjectApprovalRule, error)
public ProjectApprovalRule(string name, ProjectApprovalRuleArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args ProjectApprovalRuleArgs
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 ProjectApprovalRuleArgs
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 ProjectApprovalRuleArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ProjectApprovalRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

ProjectApprovalRule Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The ProjectApprovalRule resource accepts the following input properties:

ApprovalsRequired int
The number of approvals required for this rule.
Project string
The name or id of the project to add the approval rules.
GroupIds List<int>
A list of group IDs who’s members can approve of the merge request
Name string
The name of the approval rule.
UserIds List<int>
A list of specific User IDs to add to the list of approvers.
ApprovalsRequired int
The number of approvals required for this rule.
Project string
The name or id of the project to add the approval rules.
GroupIds []int
A list of group IDs who’s members can approve of the merge request
Name string
The name of the approval rule.
UserIds []int
A list of specific User IDs to add to the list of approvers.
approvalsRequired number
The number of approvals required for this rule.
project string
The name or id of the project to add the approval rules.
groupIds number[]
A list of group IDs who’s members can approve of the merge request
name string
The name of the approval rule.
userIds number[]
A list of specific User IDs to add to the list of approvers.
approvals_required int
The number of approvals required for this rule.
project str
The name or id of the project to add the approval rules.
group_ids Sequence[int]
A list of group IDs who’s members can approve of the merge request
name str
The name of the approval rule.
user_ids Sequence[int]
A list of specific User IDs to add to the list of approvers.

Outputs

All input properties are implicitly available as output properties. Additionally, the ProjectApprovalRule resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing ProjectApprovalRule Resource

Get an existing ProjectApprovalRule 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?: ProjectApprovalRuleState, opts?: CustomResourceOptions): ProjectApprovalRule
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        approvals_required: Optional[int] = None,
        group_ids: Optional[Sequence[int]] = None,
        name: Optional[str] = None,
        project: Optional[str] = None,
        user_ids: Optional[Sequence[int]] = None) -> ProjectApprovalRule
func GetProjectApprovalRule(ctx *Context, name string, id IDInput, state *ProjectApprovalRuleState, opts ...ResourceOption) (*ProjectApprovalRule, error)
public static ProjectApprovalRule Get(string name, Input<string> id, ProjectApprovalRuleState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

ApprovalsRequired int
The number of approvals required for this rule.
GroupIds List<int>
A list of group IDs who’s members can approve of the merge request
Name string
The name of the approval rule.
Project string
The name or id of the project to add the approval rules.
UserIds List<int>
A list of specific User IDs to add to the list of approvers.
ApprovalsRequired int
The number of approvals required for this rule.
GroupIds []int
A list of group IDs who’s members can approve of the merge request
Name string
The name of the approval rule.
Project string
The name or id of the project to add the approval rules.
UserIds []int
A list of specific User IDs to add to the list of approvers.
approvalsRequired number
The number of approvals required for this rule.
groupIds number[]
A list of group IDs who’s members can approve of the merge request
name string
The name of the approval rule.
project string
The name or id of the project to add the approval rules.
userIds number[]
A list of specific User IDs to add to the list of approvers.
approvals_required int
The number of approvals required for this rule.
group_ids Sequence[int]
A list of group IDs who’s members can approve of the merge request
name str
The name of the approval rule.
project str
The name or id of the project to add the approval rules.
user_ids Sequence[int]
A list of specific User IDs to add to the list of approvers.

Import

GitLab project approval rules can be imported using an id consisting of project-id:rule-id, e.g.

 $ pulumi import gitlab:index/projectApprovalRule:ProjectApprovalRule example "12345:6"

Package Details

Repository
https://github.com/pulumi/pulumi-gitlab
License
Apache-2.0
Notes
This Pulumi package is based on the gitlab Terraform Provider.