The gitlab_project_level_mr_approval_rule
resource allows to manage the lifecycle of a Merge Request-level approval rule.
resource "gitlab_project" "foo" {
name = "Example"
description = "My example project"
}
resource "gitlab_project_level_mr_approvals" "foo" {
project = gitlab_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
}
project
(String) The ID or URL-encoded path of a project to change MR approval configuration.disable_overriding_approvers_per_merge_request
(Boolean) Set to true
to disable overriding approvers per merge request.merge_requests_author_approval
(Boolean) Set to true
to allow merge requests authors to approve their own merge requests.merge_requests_disable_committers_approval
(Boolean) Set to true
to disable merge request committers from approving their own merge requests.require_password_to_approve
(Boolean) Set to true
to require authentication to approve merge requests.reset_approvals_on_push
(Boolean) 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
(Boolean) Reset approvals from Code Owners if their files changed. Can be enabled only if reset_approvals_on_push is disabled.id
(String) The ID of the resource. Matches the project
value.Import is supported using the following syntax:
# You can import an approval configuration state using `terraform import <resource> <project_id>`.
#
# For example:
terraform import gitlab_project_level_mr_approvals.foo 1234