gitlab_project_protected_environment mutually exclusive options
Bug Report
The resource gitlab_project_protected_environment has incomplete/wrong documentation about the mutaually exclusive fields.
Per GitLab REST API docs
Elements in the deploy_access_levels and approval_rules array should be one of user_id, group_id or access_level [...].
I added **comments** from the terraform provider docs:
### Nested Schema for `approval_rules`
Optional:
- `access_level` (String) Levels of access allowed to approve a deployment to this protected environment. Valid values are `developer`, `maintainer`. **Missing mutually exclusive alert**
- `group_id` (Number) The ID of the group allowed to approve a deployment to this protected environment. TThe group must be a sub-group under the given group. This is mutually exclusive with user_id. **Mutually exclusive alert incomplete**
- `group_inheritance_type` (Number) Group inheritance allows access rules to take inherited group membership into account. Valid values are `0`, `1`. `0` => Direct group membership only, `1` => All inherited groups. Default: `0`
- `required_approvals` (Number) The number of approval required to allow deployment to this protected environment. This is mutually exclusive with user_id. **I cannot find info about this mutually exclusive**
- `user_id` (Number) The ID of the user allowed to approve a deployment to this protected environment. The user must be a member of the group with Maintainer role or higher. This is mutually exclusive with group_id and required_approvals.
### Nested Schema for `deploy_access_levels`
Optional:
- `access_level` (String) Levels of access required to deploy to this protected environment. Valid values are `developer`, `maintainer`. **Missing mutually exclusive alert**
- `group_id` (Number) The ID of the group allowed to deploy to this protected environment. The group must be a sub-group under the given group. **Missing mutually exclusive alert**
- `group_inheritance_type` (Number) Group inheritance allows deploy access levels to take inherited group membership into account. Valid values are `0`, `1`. `0` => Direct group membership only, `1` => All inherited groups. Default: `0`
- `user_id` (Number) The ID of the user allowed to deploy to this protected environment. The user must be a member of the group with Maintainer role or higher. **Missing mutually exclusive alert**
- GitLab Terraform Provider Version:
17.1.0 - GitLab Version:
17.2.0-pre 47bae5d0ee6 - Terraform Version:
1.5.0
Edited by Gianluca Ermacora