1. Packages
  2. GitLab
  3. API Docs
  4. ProjectLevelMrApprovals
GitLab v8.1.0 published on Friday, Jun 21, 2024 by Pulumi

gitlab.ProjectLevelMrApprovals

Explore with Pulumi AI

gitlab logo
GitLab v8.1.0 published on Friday, Jun 21, 2024 by Pulumi

    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)
    
    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
    	})
    }
    
    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 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
    

    Create ProjectLevelMrApprovals Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ProjectLevelMrApprovals(name: string, args: ProjectLevelMrApprovalsArgs, opts?: CustomResourceOptions);
    @overload
    def ProjectLevelMrApprovals(resource_name: str,
                                args: ProjectLevelMrApprovalsArgs,
                                opts: Optional[ResourceOptions] = None)
    
    @overload
    def ProjectLevelMrApprovals(resource_name: str,
                                opts: Optional[ResourceOptions] = None,
                                project: Optional[str] = None,
                                disable_overriding_approvers_per_merge_request: Optional[bool] = None,
                                merge_requests_author_approval: Optional[bool] = None,
                                merge_requests_disable_committers_approval: Optional[bool] = None,
                                require_password_to_approve: Optional[bool] = None,
                                reset_approvals_on_push: Optional[bool] = None,
                                selective_code_owner_removals: Optional[bool] = None)
    func NewProjectLevelMrApprovals(ctx *Context, name string, args ProjectLevelMrApprovalsArgs, opts ...ResourceOption) (*ProjectLevelMrApprovals, error)
    public ProjectLevelMrApprovals(string name, ProjectLevelMrApprovalsArgs args, CustomResourceOptions? opts = null)
    public ProjectLevelMrApprovals(String name, ProjectLevelMrApprovalsArgs args)
    public ProjectLevelMrApprovals(String name, ProjectLevelMrApprovalsArgs args, CustomResourceOptions options)
    
    type: gitlab:ProjectLevelMrApprovals
    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 ProjectLevelMrApprovalsArgs
    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 ProjectLevelMrApprovalsArgs
    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 ProjectLevelMrApprovalsArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ProjectLevelMrApprovalsArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ProjectLevelMrApprovalsArgs
    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 projectLevelMrApprovalsResource = new GitLab.ProjectLevelMrApprovals("projectLevelMrApprovalsResource", new()
    {
        Project = "string",
        DisableOverridingApproversPerMergeRequest = false,
        MergeRequestsAuthorApproval = false,
        MergeRequestsDisableCommittersApproval = false,
        RequirePasswordToApprove = false,
        ResetApprovalsOnPush = false,
        SelectiveCodeOwnerRemovals = false,
    });
    
    example, err := gitlab.NewProjectLevelMrApprovals(ctx, "projectLevelMrApprovalsResource", &gitlab.ProjectLevelMrApprovalsArgs{
    	Project: pulumi.String("string"),
    	DisableOverridingApproversPerMergeRequest: pulumi.Bool(false),
    	MergeRequestsAuthorApproval:               pulumi.Bool(false),
    	MergeRequestsDisableCommittersApproval:    pulumi.Bool(false),
    	RequirePasswordToApprove:                  pulumi.Bool(false),
    	ResetApprovalsOnPush:                      pulumi.Bool(false),
    	SelectiveCodeOwnerRemovals:                pulumi.Bool(false),
    })
    
    var projectLevelMrApprovalsResource = new ProjectLevelMrApprovals("projectLevelMrApprovalsResource", ProjectLevelMrApprovalsArgs.builder()
        .project("string")
        .disableOverridingApproversPerMergeRequest(false)
        .mergeRequestsAuthorApproval(false)
        .mergeRequestsDisableCommittersApproval(false)
        .requirePasswordToApprove(false)
        .resetApprovalsOnPush(false)
        .selectiveCodeOwnerRemovals(false)
        .build());
    
    project_level_mr_approvals_resource = gitlab.ProjectLevelMrApprovals("projectLevelMrApprovalsResource",
        project="string",
        disable_overriding_approvers_per_merge_request=False,
        merge_requests_author_approval=False,
        merge_requests_disable_committers_approval=False,
        require_password_to_approve=False,
        reset_approvals_on_push=False,
        selective_code_owner_removals=False)
    
    const projectLevelMrApprovalsResource = new gitlab.ProjectLevelMrApprovals("projectLevelMrApprovalsResource", {
        project: "string",
        disableOverridingApproversPerMergeRequest: false,
        mergeRequestsAuthorApproval: false,
        mergeRequestsDisableCommittersApproval: false,
        requirePasswordToApprove: false,
        resetApprovalsOnPush: false,
        selectiveCodeOwnerRemovals: false,
    });
    
    type: gitlab:ProjectLevelMrApprovals
    properties:
        disableOverridingApproversPerMergeRequest: false
        mergeRequestsAuthorApproval: false
        mergeRequestsDisableCommittersApproval: false
        project: string
        requirePasswordToApprove: false
        resetApprovalsOnPush: false
        selectiveCodeOwnerRemovals: false
    

    ProjectLevelMrApprovals 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 ProjectLevelMrApprovals resource accepts the following input properties:

    Project string
    The ID or URL-encoded path of a project to change MR approval configuration.
    DisableOverridingApproversPerMergeRequest bool
    Set to true to disable overriding approvers per merge request.
    MergeRequestsAuthorApproval bool
    Set to true to allow merge requests authors to approve their own merge requests.
    MergeRequestsDisableCommittersApproval bool
    Set to true to disable merge request committers from approving their own merge requests.
    RequirePasswordToApprove bool
    Set to true to require authentication to approve merge requests.
    ResetApprovalsOnPush bool
    Set to true to remove all approvals in a merge request when new commits are pushed to its source branch. Default is true.
    SelectiveCodeOwnerRemovals bool
    Reset approvals from Code Owners if their files changed. Can be enabled only if resetapprovalson_push is disabled.
    Project string
    The ID or URL-encoded path of a project to change MR approval configuration.
    DisableOverridingApproversPerMergeRequest bool
    Set to true to disable overriding approvers per merge request.
    MergeRequestsAuthorApproval bool
    Set to true to allow merge requests authors to approve their own merge requests.
    MergeRequestsDisableCommittersApproval bool
    Set to true to disable merge request committers from approving their own merge requests.
    RequirePasswordToApprove bool
    Set to true to require authentication to approve merge requests.
    ResetApprovalsOnPush bool
    Set to true to remove all approvals in a merge request when new commits are pushed to its source branch. Default is true.
    SelectiveCodeOwnerRemovals bool
    Reset approvals from Code Owners if their files changed. Can be enabled only if resetapprovalson_push is disabled.
    project String
    The ID or URL-encoded path of a project to change MR approval configuration.
    disableOverridingApproversPerMergeRequest Boolean
    Set to true to disable overriding approvers per merge request.
    mergeRequestsAuthorApproval Boolean
    Set to true to allow merge requests authors to approve their own merge requests.
    mergeRequestsDisableCommittersApproval Boolean
    Set to true to disable merge request committers from approving their own merge requests.
    requirePasswordToApprove Boolean
    Set to true to require authentication to approve merge requests.
    resetApprovalsOnPush Boolean
    Set to true to remove all approvals in a merge request when new commits are pushed to its source branch. Default is true.
    selectiveCodeOwnerRemovals Boolean
    Reset approvals from Code Owners if their files changed. Can be enabled only if resetapprovalson_push is disabled.
    project string
    The ID or URL-encoded path of a project to change MR approval configuration.
    disableOverridingApproversPerMergeRequest boolean
    Set to true to disable overriding approvers per merge request.
    mergeRequestsAuthorApproval boolean
    Set to true to allow merge requests authors to approve their own merge requests.
    mergeRequestsDisableCommittersApproval boolean
    Set to true to disable merge request committers from approving their own merge requests.
    requirePasswordToApprove boolean
    Set to true to require authentication to approve merge requests.
    resetApprovalsOnPush boolean
    Set to true to remove all approvals in a merge request when new commits are pushed to its source branch. Default is true.
    selectiveCodeOwnerRemovals boolean
    Reset approvals from Code Owners if their files changed. Can be enabled only if resetapprovalson_push is disabled.
    project str
    The ID or URL-encoded path of a project to change MR approval configuration.
    disable_overriding_approvers_per_merge_request bool
    Set to true to disable overriding approvers per merge request.
    merge_requests_author_approval bool
    Set to true to allow merge requests authors to approve their own merge requests.
    merge_requests_disable_committers_approval bool
    Set to true to disable merge request committers from approving their own merge requests.
    require_password_to_approve bool
    Set to true to require authentication to approve merge requests.
    reset_approvals_on_push bool
    Set to true to remove all approvals in a merge request when new commits are pushed to its source branch. Default is true.
    selective_code_owner_removals bool
    Reset approvals from Code Owners if their files changed. Can be enabled only if resetapprovalson_push is disabled.
    project String
    The ID or URL-encoded path of a project to change MR approval configuration.
    disableOverridingApproversPerMergeRequest Boolean
    Set to true to disable overriding approvers per merge request.
    mergeRequestsAuthorApproval Boolean
    Set to true to allow merge requests authors to approve their own merge requests.
    mergeRequestsDisableCommittersApproval Boolean
    Set to true to disable merge request committers from approving their own merge requests.
    requirePasswordToApprove Boolean
    Set to true to require authentication to approve merge requests.
    resetApprovalsOnPush Boolean
    Set to true to remove all approvals in a merge request when new commits are pushed to its source branch. Default is true.
    selectiveCodeOwnerRemovals Boolean
    Reset approvals from Code Owners if their files changed. Can be enabled only if resetapprovalson_push is disabled.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ProjectLevelMrApprovals 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 string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing ProjectLevelMrApprovals Resource

    Get an existing ProjectLevelMrApprovals 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?: ProjectLevelMrApprovalsState, opts?: CustomResourceOptions): ProjectLevelMrApprovals
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            disable_overriding_approvers_per_merge_request: Optional[bool] = None,
            merge_requests_author_approval: Optional[bool] = None,
            merge_requests_disable_committers_approval: Optional[bool] = None,
            project: Optional[str] = None,
            require_password_to_approve: Optional[bool] = None,
            reset_approvals_on_push: Optional[bool] = None,
            selective_code_owner_removals: Optional[bool] = None) -> ProjectLevelMrApprovals
    func GetProjectLevelMrApprovals(ctx *Context, name string, id IDInput, state *ProjectLevelMrApprovalsState, opts ...ResourceOption) (*ProjectLevelMrApprovals, error)
    public static ProjectLevelMrApprovals Get(string name, Input<string> id, ProjectLevelMrApprovalsState? state, CustomResourceOptions? opts = null)
    public static ProjectLevelMrApprovals get(String name, Output<String> id, ProjectLevelMrApprovalsState 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.
    The following state arguments are supported:
    DisableOverridingApproversPerMergeRequest bool
    Set to true to disable overriding approvers per merge request.
    MergeRequestsAuthorApproval bool
    Set to true to allow merge requests authors to approve their own merge requests.
    MergeRequestsDisableCommittersApproval bool
    Set to true to disable merge request committers from approving their own merge requests.
    Project string
    The ID or URL-encoded path of a project to change MR approval configuration.
    RequirePasswordToApprove bool
    Set to true to require authentication to approve merge requests.
    ResetApprovalsOnPush bool
    Set to true to remove all approvals in a merge request when new commits are pushed to its source branch. Default is true.
    SelectiveCodeOwnerRemovals bool
    Reset approvals from Code Owners if their files changed. Can be enabled only if resetapprovalson_push is disabled.
    DisableOverridingApproversPerMergeRequest bool
    Set to true to disable overriding approvers per merge request.
    MergeRequestsAuthorApproval bool
    Set to true to allow merge requests authors to approve their own merge requests.
    MergeRequestsDisableCommittersApproval bool
    Set to true to disable merge request committers from approving their own merge requests.
    Project string
    The ID or URL-encoded path of a project to change MR approval configuration.
    RequirePasswordToApprove bool
    Set to true to require authentication to approve merge requests.
    ResetApprovalsOnPush bool
    Set to true to remove all approvals in a merge request when new commits are pushed to its source branch. Default is true.
    SelectiveCodeOwnerRemovals bool
    Reset approvals from Code Owners if their files changed. Can be enabled only if resetapprovalson_push is disabled.
    disableOverridingApproversPerMergeRequest Boolean
    Set to true to disable overriding approvers per merge request.
    mergeRequestsAuthorApproval Boolean
    Set to true to allow merge requests authors to approve their own merge requests.
    mergeRequestsDisableCommittersApproval Boolean
    Set to true to disable merge request committers from approving their own merge requests.
    project String
    The ID or URL-encoded path of a project to change MR approval configuration.
    requirePasswordToApprove Boolean
    Set to true to require authentication to approve merge requests.
    resetApprovalsOnPush Boolean
    Set to true to remove all approvals in a merge request when new commits are pushed to its source branch. Default is true.
    selectiveCodeOwnerRemovals Boolean
    Reset approvals from Code Owners if their files changed. Can be enabled only if resetapprovalson_push is disabled.
    disableOverridingApproversPerMergeRequest boolean
    Set to true to disable overriding approvers per merge request.
    mergeRequestsAuthorApproval boolean
    Set to true to allow merge requests authors to approve their own merge requests.
    mergeRequestsDisableCommittersApproval boolean
    Set to true to disable merge request committers from approving their own merge requests.
    project string
    The ID or URL-encoded path of a project to change MR approval configuration.
    requirePasswordToApprove boolean
    Set to true to require authentication to approve merge requests.
    resetApprovalsOnPush boolean
    Set to true to remove all approvals in a merge request when new commits are pushed to its source branch. Default is true.
    selectiveCodeOwnerRemovals boolean
    Reset approvals from Code Owners if their files changed. Can be enabled only if resetapprovalson_push is disabled.
    disable_overriding_approvers_per_merge_request bool
    Set to true to disable overriding approvers per merge request.
    merge_requests_author_approval bool
    Set to true to allow merge requests authors to approve their own merge requests.
    merge_requests_disable_committers_approval bool
    Set to true to disable merge request committers from approving their own merge requests.
    project str
    The ID or URL-encoded path of a project to change MR approval configuration.
    require_password_to_approve bool
    Set to true to require authentication to approve merge requests.
    reset_approvals_on_push bool
    Set to true to remove all approvals in a merge request when new commits are pushed to its source branch. Default is true.
    selective_code_owner_removals bool
    Reset approvals from Code Owners if their files changed. Can be enabled only if resetapprovalson_push is disabled.
    disableOverridingApproversPerMergeRequest Boolean
    Set to true to disable overriding approvers per merge request.
    mergeRequestsAuthorApproval Boolean
    Set to true to allow merge requests authors to approve their own merge requests.
    mergeRequestsDisableCommittersApproval Boolean
    Set to true to disable merge request committers from approving their own merge requests.
    project String
    The ID or URL-encoded path of a project to change MR approval configuration.
    requirePasswordToApprove Boolean
    Set to true to require authentication to approve merge requests.
    resetApprovalsOnPush Boolean
    Set to true to remove all approvals in a merge request when new commits are pushed to its source branch. Default is true.
    selectiveCodeOwnerRemovals Boolean
    Reset approvals from Code Owners if their files changed. Can be enabled only if resetapprovalson_push is disabled.

    Import

    $ 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
    

    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.
    gitlab logo
    GitLab v8.1.0 published on Friday, Jun 21, 2024 by Pulumi