Add resource_project_branch_permissions (#47)

Resolves gavinbunney/terraform-provider-bitbucketserver#17
This commit is contained in:
Stanislau Liamniou
2022-06-17 18:27:16 +02:00
committed by GitHub
parent 2e2fc4e78f
commit bd6992d6e0
5 changed files with 498 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
# Resource: bitbucketserver_project_branch_permissions
Provides the ability to apply project ref restrictions to enforce branch permissions. A restriction means preventing writes on the specified branch(es) by all except a set of users and/or groups, or preventing specific operations such as branch deletion.
## Example Usage
```hcl
resource "bitbucketserver_project_branch_permissions" "pr_only" {
project = "MYPROJ"
repository = "repo"
ref_pattern = "refs/heads/master"
type = "pull-request-only"
}
resource "bitbucketserver_project_branch_permissions" "no_deletes" {
project = "MYPROJ"
repository = "repo"
ref_pattern = "heads/**/master"
type = "no-deletes"
exception_users = ["admin"]
exception_groups = ["group_1", "group_2"]
}
```
## Argument Reference
* `project` - Required. Project Key that contains target repository.
* `repository` - Required. Repository slug of target repository.
* `ref_pattern` - Required. A wildcard pattern that may match multiple branches. You must specify a valid [Branch Permission Pattern](https://confluence.atlassian.com/bitbucketserver/branch-permission-patterns-776639814.html).
* `type` - Required. Type of the restriction. Must be one of `pull-request-only`, `fast-forward-only`, `no-deletes`, `read-only`.
* `exception_users` - Optional. List of usernames to whom restrictions do not apply.
* `exception_groups` - Optional. List of group names to which restrictions do not apply.
* `exception_access_keys` - Optional. List of access keys IDs to which restrictions do not apply.