1. Packages
  2. GitLab
  3. API Docs
  4. ProjectLevelMrApprovals
GitLab v6.10.0 published on Monday, Mar 25, 2024 by Pulumi

gitlab.ProjectLevelMrApprovals

Explore with Pulumi AI

gitlab logo
GitLab v6.10.0 published on Monday, Mar 25, 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 fooProject = new gitlab.Project("fooProject", {description: "My example project"});
    const fooProjectLevelMrApprovals = new gitlab.ProjectLevelMrApprovals("fooProjectLevelMrApprovals", {
        project: fooProject.id,
        resetApprovalsOnPush: true,
        disableOverridingApproversPerMergeRequest: false,
        mergeRequestsAuthorApproval: false,
        mergeRequestsDisableCommittersApproval: true,
    });
    
    import pulumi
    import pulumi_gitlab as gitlab
    
    foo_project = gitlab.Project("fooProject", description="My example project")
    foo_project_level_mr_approvals = gitlab.ProjectLevelMrApprovals("fooProjectLevelMrApprovals",
        project=foo_project.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/v6/go/gitlab"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		fooProject, err := gitlab.NewProject(ctx, "fooProject", &gitlab.ProjectArgs{
    			Description: pulumi.String("My example project"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = gitlab.NewProjectLevelMrApprovals(ctx, "fooProjectLevelMrApprovals", &gitlab.ProjectLevelMrApprovalsArgs{
    			Project:              fooProject.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 fooProject = new GitLab.Project("fooProject", new()
        {
            Description = "My example project",
        });
    
        var fooProjectLevelMrApprovals = new GitLab.ProjectLevelMrApprovals("fooProjectLevelMrApprovals", new()
        {
            Project = fooProject.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 fooProject = new Project("fooProject", ProjectArgs.builder()        
                .description("My example project")
                .build());
    
            var fooProjectLevelMrApprovals = new ProjectLevelMrApprovals("fooProjectLevelMrApprovals", ProjectLevelMrApprovalsArgs.builder()        
                .project(fooProject.id())
                .resetApprovalsOnPush(true)
                .disableOverridingApproversPerMergeRequest(false)
                .mergeRequestsAuthorApproval(false)
                .mergeRequestsDisableCommittersApproval(true)
                .build());
    
        }
    }
    
    resources:
      fooProject:
        type: gitlab:Project
        properties:
          description: My example project
      fooProjectLevelMrApprovals:
        type: gitlab:ProjectLevelMrApprovals
        properties:
          project: ${fooProject.id}
          resetApprovalsOnPush: true
          disableOverridingApproversPerMergeRequest: false
          mergeRequestsAuthorApproval: false
          mergeRequestsDisableCommittersApproval: true
    

    Create ProjectLevelMrApprovals Resource

    new ProjectLevelMrApprovals(name: string, args: ProjectLevelMrApprovalsArgs, opts?: CustomResourceOptions);
    @overload
    def ProjectLevelMrApprovals(resource_name: 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)
    @overload
    def ProjectLevelMrApprovals(resource_name: str,
                                args: ProjectLevelMrApprovalsArgs,
                                opts: Optional[ResourceOptions] = 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.
    
    
    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.

    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
    

    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 v6.10.0 published on Monday, Mar 25, 2024 by Pulumi