ProjectLevelMrApprovalsArgs

data class ProjectLevelMrApprovalsArgs(val disableOverridingApproversPerMergeRequest: Output<Boolean>? = null, val mergeRequestsAuthorApproval: Output<Boolean>? = null, val mergeRequestsDisableCommittersApproval: Output<Boolean>? = null, val project: Output<String>? = null, val requirePasswordToApprove: Output<Boolean>? = null, val resetApprovalsOnPush: Output<Boolean>? = null, val selectiveCodeOwnerRemovals: Output<Boolean>? = null) : ConvertibleToJava<ProjectLevelMrApprovalsArgs>

The gitlab_project_level_mr_approval_rule resource allows to manage the lifecycle of a Merge Request-level approval rule.

This resource requires a GitLab Enterprise instance. Upstream API: GitLab REST API docs

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
const foo = new gitlab.Project("foo", {
name: "Example",
description: "My example project",
});
const fooProjectLevelMrApprovals = new gitlab.ProjectLevelMrApprovals("foo", {
project: foo.id,
resetApprovalsOnPush: true,
disableOverridingApproversPerMergeRequest: false,
mergeRequestsAuthorApproval: false,
mergeRequestsDisableCommittersApproval: true,
});
import pulumi
import pulumi_gitlab as gitlab
foo = gitlab.Project("foo",
name="Example",
description="My example project")
foo_project_level_mr_approvals = gitlab.ProjectLevelMrApprovals("foo",
project=foo.id,
reset_approvals_on_push=True,
disable_overriding_approvers_per_merge_request=False,
merge_requests_author_approval=False,
merge_requests_disable_committers_approval=True)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;
return await Deployment.RunAsync(() =>
{
var foo = new GitLab.Project("foo", new()
{
Name = "Example",
Description = "My example project",
});
var fooProjectLevelMrApprovals = new GitLab.ProjectLevelMrApprovals("foo", new()
{
Project = foo.Id,
ResetApprovalsOnPush = true,
DisableOverridingApproversPerMergeRequest = false,
MergeRequestsAuthorApproval = false,
MergeRequestsDisableCommittersApproval = true,
});
});
package main
import (
"github.com/pulumi/pulumi-gitlab/sdk/v8/go/gitlab"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
foo, err := gitlab.NewProject(ctx, "foo", &gitlab.ProjectArgs{
Name: pulumi.String("Example"),
Description: pulumi.String("My example project"),
})
if err != nil {
return err
}
_, err = gitlab.NewProjectLevelMrApprovals(ctx, "foo", &gitlab.ProjectLevelMrApprovalsArgs{
Project: foo.ID(),
ResetApprovalsOnPush: pulumi.Bool(true),
DisableOverridingApproversPerMergeRequest: pulumi.Bool(false),
MergeRequestsAuthorApproval: pulumi.Bool(false),
MergeRequestsDisableCommittersApproval: pulumi.Bool(true),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.Project;
import com.pulumi.gitlab.ProjectArgs;
import com.pulumi.gitlab.ProjectLevelMrApprovals;
import com.pulumi.gitlab.ProjectLevelMrApprovalsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var foo = new Project("foo", ProjectArgs.builder()
.name("Example")
.description("My example project")
.build());
var fooProjectLevelMrApprovals = new ProjectLevelMrApprovals("fooProjectLevelMrApprovals", ProjectLevelMrApprovalsArgs.builder()
.project(foo.id())
.resetApprovalsOnPush(true)
.disableOverridingApproversPerMergeRequest(false)
.mergeRequestsAuthorApproval(false)
.mergeRequestsDisableCommittersApproval(true)
.build());
}
}
resources:
foo:
type: gitlab:Project
properties:
name: Example
description: My example project
fooProjectLevelMrApprovals:
type: gitlab:ProjectLevelMrApprovals
name: foo
properties:
project: ${foo.id}
resetApprovalsOnPush: true
disableOverridingApproversPerMergeRequest: false
mergeRequestsAuthorApproval: false
mergeRequestsDisableCommittersApproval: true

Import

Starting in Terraform v1.5.0 you can use an import block to import gitlab_project_level_mr_approvals. For example: terraform import { to = gitlab_project_level_mr_approvals.example id = "see CLI command below for ID" } Import using the CLI is supported using the following syntax:

$ pulumi import gitlab:index/projectLevelMrApprovals:ProjectLevelMrApprovals You can import an approval configuration state using `<resource> <project_id>`.

For example:

$ pulumi import gitlab:index/projectLevelMrApprovals:ProjectLevelMrApprovals foo 1234

Constructors

Link copied to clipboard
constructor(disableOverridingApproversPerMergeRequest: Output<Boolean>? = null, mergeRequestsAuthorApproval: Output<Boolean>? = null, mergeRequestsDisableCommittersApproval: Output<Boolean>? = null, project: Output<String>? = null, requirePasswordToApprove: Output<Boolean>? = null, resetApprovalsOnPush: Output<Boolean>? = null, selectiveCodeOwnerRemovals: Output<Boolean>? = null)

Properties

Set to true to disable overriding approvers per merge request.

Link copied to clipboard

Set to true to allow merge requests authors to approve their own merge requests.

Link copied to clipboard

Set to true to disable merge request committers from approving their own merge requests.

Link copied to clipboard
val project: Output<String>? = null

The ID or URL-encoded path of a project to change MR approval configuration.

Link copied to clipboard
val requirePasswordToApprove: Output<Boolean>? = null

Set to true to require authentication to approve merge requests.

Link copied to clipboard
val resetApprovalsOnPush: Output<Boolean>? = null

Set to true to remove all approvals in a merge request when new commits are pushed to its source branch. Default is true.

Link copied to clipboard
val selectiveCodeOwnerRemovals: Output<Boolean>? = null

Reset approvals from Code Owners if their files changed. Can be enabled only if resetapprovalson_push is disabled.

Functions

Link copied to clipboard
open override fun toJava(): ProjectLevelMrApprovalsArgs